feat: cargo unload challenge

This commit is contained in:
Ilia Denisov
2026-02-21 09:57:02 +02:00
parent 233c9ebc2a
commit 9e36d7151e
12 changed files with 137 additions and 166 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ const (
StateLaunched ShipGroupState = "Launched"
StateInSpace ShipGroupState = "In_Space"
StateUpgrade ShipGroupState = "Upgrade"
StateTransfer ShipGroupState = "Transfer" // TODO: Группы будут передаваться мгновенно в начале производства хода
StateTransfer ShipGroupState = "Transfer" // [ ] Группы будут передаваться мгновенно в начале производства хода
)
func (sgs ShipGroupState) String() string {
+7 -2
View File
@@ -16,11 +16,11 @@ func (o *Order) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, o)
}
func AsCommand[E DecodableCommand](c DecodableCommand) (E, bool) {
func AsCommand[E DecodableCommand](c DecodableCommand) (result E, ok bool) {
if v, ok := c.(E); ok {
return v, true
}
return *new(E), false
return
}
type CommandType string
@@ -56,6 +56,7 @@ func (ct CommandType) String() string {
}
type DecodableCommand interface {
CommandID() string
CommandType() CommandType
}
@@ -70,6 +71,10 @@ func (cm CommandMeta) CommandType() CommandType {
return cm.CmdType
}
func (cm CommandMeta) CommandID() string {
return cm.CmdID
}
func (cm *CommandMeta) Result(errCode int) {
cm.CmdErrCode = &errCode
cm.CmdApplied = new(bool(errCode == 0))
+1 -1
View File
@@ -12,7 +12,7 @@ type LocalPlanet struct {
Colonists Float `json:"colonists"` // COL C - Количество колонистов
Production string `json:"production"`
FreeIndustry Float `json:"freeInductry"` // Параметр "L" - Свободный производственный потенциал
// TODO: FreeIndustry - неактуальная информация, т.к. модернизация происходит в процессе производства хода
// [ ] FreeIndustry - неактуальная информация, т.к. модернизация происходит в процессе производства хода
}
type UninhabitedPlanet struct {