aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
Diffstat (limited to 'go')
-rw-r--r--go/game/state.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/go/game/state.go b/go/game/state.go
index d91bbe35..e7d77f4c 100644
--- a/go/game/state.go
+++ b/go/game/state.go
@@ -234,40 +234,6 @@ func (s *LocalState) stateBasedActions() []*Player {
return w
}
-func (s *LocalState) IsValidPlay(a *PlayAction) error {
- if a.Card.IsPermanent() {
- // Equipments may be played not on a spawn tile but equiped to the next played unit
- if a.Card.Type == CardTypes.Equipment && len(a.Target().sel) == 0 {
- return nil
- }
-
- spawn := a.Target().sel[0].(*Tile)
- if !slices.Contains(s.AvailableSpawnTiles(a.Source().(*Player), a.Card), spawn) {
- return fmt.Errorf("spawn %v is not a valid spawn tile for %s",
- spawn.Position.String(), a.Card.Name)
- }
- }
-
- return nil
-}
-
-func (s *LocalState) IsValidMove(a *MoveAction) error {
- u := a.Source().(*Unit)
- tile := relaxedTileTarget(a, a.Target().sel[0])
-
- if !slices.Contains(u.MoveRangeTiles(), tile) {
- return fmt.Errorf("unit %s@%v can not move to %s",
- u.card.Name, u.tile.Position, tile.Position.String())
- }
-
- if !u.IsAvailableTile(tile) {
- return fmt.Errorf("unit %s@%v can not move to not available tile %v",
- u.card.Name, u.tile.Position, tile)
- }
-
- return nil
-}
-
func (s *LocalState) isValidBuy(a *BuyAction) error {
card := a.card()
if s._map.HasStores() {
@@ -354,10 +320,6 @@ func (s *LocalState) ValidateAction(a Action) (err error) {
}
switch a := a.(type) {
- case *PlayAction:
- err = s.IsValidPlay(a)
- case *MoveAction:
- err = s.IsValidMove(a)
case *EquipAction:
err = s.IsValidEquip(a)
case *ArtifactSwitchAction: