fix compilation errors and warnings
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user