From 4e2ab55d345fd5e5c5d2d5bc56948611b15564d5 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 27 Dec 2024 12:40:19 +0100 Subject: introduce game.State interface abstraction This allows to not use the internal game state directly from client code. --- go/game/unit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'go/game/unit.go') diff --git a/go/game/unit.go b/go/game/unit.go index b71596d4..fd08b481 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -159,7 +159,7 @@ func (u *Unit) AvailSlowActions() (actions []Action) { actions = append(actions, NewMoveAction(u)) } - m := u.Controller().gameState.Map + m := u.Controller().gameState.Map() if u.AvailAttackActions > 0 && !INVALID_ATTACK(u.Attack) && len(u.AttackableEnemyPermanents(m)) > 0 { @@ -221,7 +221,7 @@ func (u *Unit) AvailFreeActions() (actions []Action) { func (u *Unit) CurrentlyAvailActions() (actions []Action) { s := u.Controller().gameState - if s.ActivePlayer == u.Controller() && s.ActivePhase == Phases.ActionPhase { + if s.IsActivePlayer(u.Controller()) && s.ActivePhase() == Phases.ActionPhase { actions = append(actions, u.AvailSlowActions()...) } actions = append(actions, u.AvailFreeActions()...) -- cgit v1.2.3