Converting cards to effectstables
This commit is contained in:
@@ -170,26 +170,40 @@ func NewKoboldMine() *KoboldMine {
|
||||
type FieldLabel string
|
||||
|
||||
const (
|
||||
Authoritarianism FieldLabel = "Authoritarianism"
|
||||
BasePopulation FieldLabel = "BasePopulation"
|
||||
Bureaucracy FieldLabel = "Bureaucracy"
|
||||
Construction FieldLabel = "Construction"
|
||||
Cruelty FieldLabel = "Cruelty"
|
||||
Education FieldLabel = "Education"
|
||||
FoodSupply FieldLabel = "FoodSupply"
|
||||
ForeignRelations FieldLabel = "ForeignRelations"
|
||||
Gullibility FieldLabel = "Gullibility"
|
||||
Madness FieldLabel = "Madness"
|
||||
Manufacturing FieldLabel = "Manufacturing"
|
||||
Mining FieldLabel = "Mining"
|
||||
Militarism FieldLabel = "Militarism"
|
||||
Rebellion FieldLabel = "Rebellion"
|
||||
Scavenging FieldLabel = "Scavenging"
|
||||
Secrecy FieldLabel = "Secrecy"
|
||||
Alchemy FieldLabel = "Alchemy"
|
||||
Authoritarianism FieldLabel = "Authoritarianism"
|
||||
BasePopulation FieldLabel = "BasePopulation"
|
||||
Bureaucracy FieldLabel = "Bureaucracy"
|
||||
Construction FieldLabel = "Construction"
|
||||
Cruelty FieldLabel = "Cruelty"
|
||||
Education FieldLabel = "Education"
|
||||
FoodSupply FieldLabel = "FoodSupply"
|
||||
ForeignRelations FieldLabel = "ForeignRelations"
|
||||
ForeignRelExpense FieldLabel = "ForeignRelExpense"
|
||||
Gadgetry FieldLabel = "Gadgetry"
|
||||
Greed FieldLabel = "Greed"
|
||||
Gullibility FieldLabel = "Gullibility"
|
||||
Healthcare FieldLabel = "Healthcare"
|
||||
HiddenRelPenalty FieldLabel = "HiddenRelPenalty"
|
||||
Hospitality FieldLabel = "Hospitality"
|
||||
Logistics FieldLabel = "Logistics"
|
||||
Madness FieldLabel = "Madness"
|
||||
Manufacturing FieldLabel = "Manufacturing"
|
||||
Militarism FieldLabel = "Militarism"
|
||||
Mining FieldLabel = "Mining"
|
||||
ParksExpense FieldLabel = "ParksExpense"
|
||||
Publishing FieldLabel = "Publishing"
|
||||
Rebellion FieldLabel = "Rebellion"
|
||||
Scavenging FieldLabel = "Scavenging"
|
||||
Secrecy FieldLabel = "Secrecy"
|
||||
Welfare FieldLabel = "Welfare"
|
||||
)
|
||||
|
||||
func (k *KoboldMine) Add(which FieldLabel, amount float64) error {
|
||||
switch which {
|
||||
case Alchemy:
|
||||
k.Alchemy += amount
|
||||
return nil
|
||||
case Authoritarianism:
|
||||
k.Authoritarianism += amount
|
||||
return nil
|
||||
@@ -214,20 +228,47 @@ func (k *KoboldMine) Add(which FieldLabel, amount float64) error {
|
||||
case ForeignRelations:
|
||||
k.ForeignRelations += amount
|
||||
return nil
|
||||
case ForeignRelExpense:
|
||||
k.ForeignRelExpense += amount
|
||||
return nil
|
||||
case Gadgetry:
|
||||
k.Gadgetry += amount
|
||||
return nil
|
||||
case Greed:
|
||||
k.Greed += amount
|
||||
return nil
|
||||
case Gullibility:
|
||||
k.Gullibility += amount
|
||||
return nil
|
||||
case Healthcare:
|
||||
k.Healthcare += amount
|
||||
return nil
|
||||
case HiddenRelPenalty:
|
||||
k.HiddenRelPenalty += amount
|
||||
return nil
|
||||
case Hospitality:
|
||||
k.Hospitality += amount
|
||||
return nil
|
||||
case Logistics:
|
||||
k.Logistics += amount
|
||||
return nil
|
||||
case Madness:
|
||||
k.Madness += amount
|
||||
return nil
|
||||
case Manufacturing:
|
||||
k.Manufacturing += amount
|
||||
return nil
|
||||
case Militarism:
|
||||
k.Militarism += amount
|
||||
return nil
|
||||
case Mining:
|
||||
k.Mining += amount
|
||||
return nil
|
||||
case Militarism:
|
||||
k.Militarism += amount
|
||||
case ParksExpense:
|
||||
k.ParksExpense += amount
|
||||
return nil
|
||||
case Publishing:
|
||||
k.Publishing += amount
|
||||
return nil
|
||||
case Rebellion:
|
||||
k.Rebellion += amount
|
||||
@@ -238,6 +279,9 @@ func (k *KoboldMine) Add(which FieldLabel, amount float64) error {
|
||||
case Secrecy:
|
||||
k.Secrecy += amount
|
||||
return nil
|
||||
case Welfare:
|
||||
k.Welfare += amount
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("cannot add %f to %q: %w", amount, which, ErrNoFieldLabel)
|
||||
}
|
||||
|
Reference in New Issue
Block a user