From bd2fb50c819c2b180758308ef3751e7ea73e6ab7 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 17 Feb 2025 00:40:43 +0100 Subject: [golang] implement shipyards visits --- golang/pkg/model/common.go | 4 ++++ golang/pkg/model/shipyard.go | 35 +++++++++++++++++++++++++++++++++++ golang/pkg/model/waypoint.go | 8 ++++++++ 3 files changed, 47 insertions(+) create mode 100644 golang/pkg/model/shipyard.go (limited to 'golang/pkg/model') diff --git a/golang/pkg/model/common.go b/golang/pkg/model/common.go index 058b43d..6a2c321 100644 --- a/golang/pkg/model/common.go +++ b/golang/pkg/model/common.go @@ -5,3 +5,7 @@ type Common struct { //Name string `json:"name"` Symbol string `json:"symbol"` } + +type CommonType struct { + Type string `json:"type"` +} diff --git a/golang/pkg/model/shipyard.go b/golang/pkg/model/shipyard.go new file mode 100644 index 0000000..2ba2e95 --- /dev/null +++ b/golang/pkg/model/shipyard.go @@ -0,0 +1,35 @@ +package model + +import "time" + +type Shipyard struct { + ModificationFee int `json:"modificationFee"` + Symbol string `json:"symbol"` + ShipTypes []CommonType `json:"shipTypes"` + Transactions []ShipyardTransaction `json:"transactions"` + Ships []ShipyardShip `json:"ships"` +} + +type ShipyardShip struct { + Activity string `json:"activity"` + // crew + //Description string `json:"description"` + // engine + // frame + // modules + // mounts + //Name string `json:"name"` + PurchasePrice int `json:"purchasePrice"` + // reactor + Supply string `json:"supply"` + Type string `json:"type"` +} + +type ShipyardTransaction struct { + AgentSymbol string `json:"agentSymbol"` + Price int `json:"price"` + ShipSymbol string `json:"shipSymbol"` + ShipType string `json:"shipType"` + Timestamp time.Time `json:"timestamp"` + WaypointSymbol string `json:"waypointSymbol"` +} diff --git a/golang/pkg/model/waypoint.go b/golang/pkg/model/waypoint.go index 7b71e6a..d8bd5cd 100644 --- a/golang/pkg/model/waypoint.go +++ b/golang/pkg/model/waypoint.go @@ -14,3 +14,11 @@ type Waypoint struct { X int `json:"x"` Y int `json:"y"` } + +func (w Waypoint) GetX() int { + return w.X +} + +func (w Waypoint) GetY() int { + return w.Y +} -- cgit v1.2.3