feat: cargo unload challenge
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user