diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-19 19:28:52 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:26 +0200 |
| commit | e58d14f6e2efe7518bc693ced6e72bdda4c8f35e (patch) | |
| tree | b7f4aebb48432bad71fa428328f48352fff0e8a0 /go/game/equipment.go | |
| parent | a17b7d9f4db676baedd7d580adc9c26cf9f2d541 (diff) | |
| download | muhqs-game-e58d14f6e2efe7518bc693ced6e72bdda4c8f35e.tar.gz muhqs-game-e58d14f6e2efe7518bc693ced6e72bdda4c8f35e.zip | |
fix broken permanent initializations
Diffstat (limited to 'go/game/equipment.go')
| -rw-r--r-- | go/game/equipment.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/go/game/equipment.go b/go/game/equipment.go index 32bb358c..ce21750f 100644 --- a/go/game/equipment.go +++ b/go/game/equipment.go @@ -1,16 +1,20 @@ package game +import ( + "log" +) + type Equipment struct { Artifact Durability int } -func newEquipmentFromPath(cardPath string, containing interface{}, owner *Player) *Equipment { +func newEquipmentFromPath(cardPath string, containing any, owner *Player) *Equipment { card := NewCard(cardPath) return newEquipment(card, containing, owner) } -func newEquipment(card *Card, containing interface{}, owner *Player) *Equipment { +func newEquipment(card *Card, containing any, owner *Player) *Equipment { e := &Equipment{ *NewArtifact(card, nil, owner), card.Values["durability"].(int), @@ -22,6 +26,8 @@ func newEquipment(card *Card, containing interface{}, owner *Player) *Equipment e.tile = containing case *Unit: addPermanentToPile(containing, e) + default: + log.Panicf("unhandled containing type: %t\n", containing) } } |
