cmd: giveaway group

This commit is contained in:
Ilia Denisov
2025-12-09 22:25:37 +03:00
parent 7002f3d299
commit 52bd71d1be
6 changed files with 187 additions and 7 deletions
+6
View File
@@ -19,10 +19,12 @@ const (
ErrEntityInUse = 5006
ErrShipsBusy = 5007
ErrShipsNotOnSamePlanet = 5008
ErrGiveawayGroupShipsTypeNotEqual = 5009
)
const (
ErrInputUnknownRace int = 3000 + iota
ErrInputSameRace
ErrInputEntityTypeNameInvalid
ErrInputEntityTypeNameDuplicate
ErrInputEntityTypeNameEquality
@@ -50,6 +52,8 @@ func GenericErrorText(code int) string {
return "Invalid game state"
case ErrInputUnknownRace:
return "Race name is unknown to this game"
case ErrInputSameRace:
return "Race name must be different from your own"
case ErrInputEntityTypeNameInvalid:
return "Name has invalid length or symbols"
case ErrInputEntityTypeNameDuplicate:
@@ -98,6 +102,8 @@ func GenericErrorText(code int) string {
return "Ships currently not in orbit or free to use"
case ErrShipsNotOnSamePlanet:
return "Ships not on the same planet"
case ErrGiveawayGroupShipsTypeNotEqual:
return "Ship type already defined with different specifications"
default:
return fmt.Sprintf("Undescribed error with code %d", code)
}