Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Documentation
data GameChange index player piece Source
AddPiece (index, index) player piece | |
RemovePiece (index, index) | |
MovePiece (index, index) (index, index) |
getPieceAt :: Ix index => GameState index tile player piece -> (index, index) -> Maybe (player, piece) Source
data GameState index tile player piece Source
GameState | |
|
class PlayableGame a index tile player piece | a -> index, a -> tile, a -> player, a -> piece where Source
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