aboutsummaryrefslogtreecommitdiff
path: root/go/game/unit.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/unit.go')
-rw-r--r--go/game/unit.go7
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 {