race quit, transfer state, refactor

This commit is contained in:
Ilia Denisov
2026-02-07 01:59:11 +02:00
parent 43ba5eb07c
commit fc73cbf83a
27 changed files with 520 additions and 341 deletions
+4 -1
View File
@@ -27,6 +27,7 @@ const (
ErrUpgradeInsufficientResources = 5011
ErrSendShipHasNoDrives = 5012
ErrSendUnreachableDestination = 5013
ErrRaceExinct = 5014
)
const (
@@ -141,7 +142,7 @@ func GenericErrorText(code int) string {
case ErrBeakGroupNumberNotEnough:
return "Not enough ships in the group to make a separate group"
case ErrShipsBusy:
return "Ships currently not in orbit or free to use"
return "Ship(s) are'n free to use"
case ErrShipsNotOnSamePlanet:
return "Ships not on the same planet"
case ErrGiveawayGroupShipsTypeNotEqual:
@@ -166,6 +167,8 @@ func GenericErrorText(code int) string {
return "One or more ships are not equipped with hyperdrive and cannot be moved"
case ErrSendUnreachableDestination:
return "Destination planet is too far for current Drive level"
case ErrRaceExinct:
return "Race is extinct"
default:
return fmt.Sprintf("Undescribed error with code %d", code)
}
+4
View File
@@ -1,5 +1,9 @@
package error
func NewRaceExinctError(arg ...any) error {
return newGenericError(ErrRaceExinct, arg...)
}
func NewGameNotInitializedError(arg ...any) error {
return newGenericError(ErrGameNotInitialized, arg...)
}