diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-22 11:12:16 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-22 12:54:28 -0400 |
| commit | dccae564f4e2c99a1352eedfbb0bba510b35dab9 (patch) | |
| tree | 833762eecbf2ae27dc647c5cd90c7f34d5331ca8 /go/game/unit.go | |
| parent | 1eacb0795451a4cf267a091b6b66e182d3c47bcf (diff) | |
| download | muhqs-game-dccae564f4e2c99a1352eedfbb0bba510b35dab9.tar.gz muhqs-game-dccae564f4e2c99a1352eedfbb0bba510b35dab9.zip | |
add unit assertion
Diffstat (limited to 'go/game/unit.go')
| -rw-r--r-- | go/game/unit.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/go/game/unit.go b/go/game/unit.go index 75015a30..85c6b97c 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -1,5 +1,9 @@ package game +import ( + "log" +) + const ( DEFAULT_AVAIL_MOVE_ACTIONS = 1 DEFAULT_AVAIL_ATTACK_ACTIONS = 1 @@ -21,6 +25,9 @@ type Unit struct { } func NewUnit(card *Card, tile *Tile, owner *Player) *Unit { + if card.Type != CardTypes.Unit { + log.Panic(card.Name, " is not a unit") + } var movement Movement movementDesc, found := card.Values["movement"] if !found { |
