cmd: planet production

This commit is contained in:
Ilia Denisov
2025-10-02 02:05:00 +03:00
parent 8a7e2f57c7
commit 0890bf3009
7 changed files with 160 additions and 19 deletions
+3
View File
@@ -31,6 +31,7 @@ const (
ErrInputShipTypeWeaponsAndArmamentValue
ErrInputShipTypeZeroValues
ErrInputScienceSumValues
ErrInputProductionInvalid
)
func GenericErrorText(code int) string {
@@ -77,6 +78,8 @@ func GenericErrorText(code int) string {
return "Science in production on the Planet"
case ErrInputScienceSumValues:
return "Science proportions sum should be equal 1"
case ErrInputProductionInvalid:
return "Invalid Production type"
default:
return fmt.Sprintf("Undescribed error with code %d", code)
}
+4
View File
@@ -59,3 +59,7 @@ func NewShipTypeShipTypeZeroValuesError(arg ...any) error {
func NewScienceSumValuesError(arg ...any) error {
return newGenericError(ErrInputScienceSumValues, arg...)
}
func NewProductionInvalidError(arg ...any) error {
return newGenericError(ErrInputProductionInvalid, arg...)
}