fix compilation errors and warnings

This commit is contained in:
2024-09-29 10:27:15 -07:00
parent ba5171fd67
commit d2a00d2044
3 changed files with 23 additions and 17 deletions

View File

@@ -1,6 +1,8 @@
package koboldsim
import (
"fmt"
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
)
@@ -168,19 +170,19 @@ func NewKoboldMine() *KoboldMine {
type FieldLabel string
const (
BasePopulation FieldLabel = "BasePopulation"
Scavenging FieldLabel = "Scavenging"
Militarism FieldLabel = "Militarism"
FoodSupply FieldLabel = "FoodSupply"
BasePopulation FieldLabel = "BasePopulation"
Scavenging FieldLabel = "Scavenging"
Militarism FieldLabel = "Militarism"
FoodSupply FieldLabel = "FoodSupply"
ForeignRelations FieldLabel = "ForeignRelations"
Rebellion FieldLabel = "Rebellion"
Madness FieldLabel = "Madness"
Cruelty FieldLabel = "Cruelty"
Rebellion FieldLabel = "Rebellion"
Madness FieldLabel = "Madness"
Cruelty FieldLabel = "Cruelty"
Authoritarianism FieldLabel = "Authoritarianism"
)
func (k *KoboldMine) Add(which FieldLabel, amount float64) error {
switch(which) {
switch which {
case BasePopulation:
k.BasePopulation += amount
return nil
@@ -209,5 +211,5 @@ func (k *KoboldMine) Add(which FieldLabel, amount float64) error {
k.Authoritarianism += amount
return nil
}
return fmt.Errorf("cannot add %d to %q: %w", amount, which, ErrNoFieldLabel)
return fmt.Errorf("cannot add %f to %q: %w", amount, which, ErrNoFieldLabel)
}