gtk-helpers-0.0.9.1: A collection of auxiliary operations and widgets related to Gtk+

Safe HaskellSafe
LanguageHaskell98

Game.Board.BasicTurnGame

Documentation

data GameChange index player piece Source #

Constructors

AddPiece (index, index) player piece 
RemovePiece (index, index) 
MovePiece (index, index) (index, index) 

hasPiece :: Ix index => GameState index tile player piece -> (index, index) -> Bool Source #

getPieceAt :: Ix index => GameState index tile player piece -> (index, index) -> Maybe (player, piece) Source #

data GameState index tile player piece Source #

Constructors

GameState 

Fields

class PlayableGame a index tile player piece | a -> index, a -> tile, a -> player, a -> piece where Source #

Minimal complete definition

curPlayer, allPieces, allPos

Methods

curPlayer :: a -> player Source #

allPieces :: a -> [(index, index, player, piece)] Source #

allPos :: a -> [(index, index, tile)] Source #

moveEnabled :: a -> Bool Source #

canMove :: a -> player -> (index, index) -> Bool Source #

canMoveTo :: a -> player -> (index, index) -> (index, index) -> Bool Source #

move :: a -> player -> (index, index) -> (index, index) -> [GameChange index player piece] Source #

activateEnabled :: a -> Bool Source #

canActivate :: a -> player -> (index, index) -> Bool Source #

activate :: a -> player -> (index, index) -> [GameChange index player piece] Source #

applyChange :: a -> GameChange index player piece -> a Source #

applyChanges :: a -> [GameChange index player piece] -> a Source #