Safe Haskell | None |
---|
Data structures that wrap and provide a higher-level interface to the SGF game tree, including a zipper that navigates the tree and provides the current board state.
- data RootInfo = RootInfo {}
- data GameInfo = GameInfo {
- gameInfoRootInfo :: RootInfo
- gameInfoBlackName :: Maybe String
- gameInfoBlackTeamName :: Maybe String
- gameInfoBlackRank :: Maybe String
- gameInfoWhiteName :: Maybe String
- gameInfoWhiteTeamName :: Maybe String
- gameInfoWhiteRank :: Maybe String
- gameInfoRuleset :: Maybe Ruleset
- gameInfoBasicTimeSeconds :: Maybe Rational
- gameInfoOvertime :: Maybe String
- gameInfoResult :: Maybe GameResult
- gameInfoGameName :: Maybe String
- gameInfoGameComment :: Maybe String
- gameInfoOpeningComment :: Maybe String
- gameInfoEvent :: Maybe String
- gameInfoRound :: Maybe String
- gameInfoPlace :: Maybe String
- gameInfoDatesPlayed :: Maybe String
- gameInfoSource :: Maybe String
- gameInfoCopyright :: Maybe String
- gameInfoAnnotatorName :: Maybe String
- gameInfoEntererName :: Maybe String
- emptyGameInfo :: RootInfo -> GameInfo
- internalIsGameInfoNode :: Node -> Bool
- gameInfoToProperties :: GameInfo -> [Property]
- data BoardState = BoardState {}
- boardWidth :: BoardState -> Int
- boardHeight :: BoardState -> Int
- data CoordState = CoordState {
- coordStar :: Bool
- coordStone :: Maybe Color
- coordMark :: Maybe Mark
- coordVisible :: Bool
- coordDimmed :: Bool
- rootBoardState :: Node -> BoardState
- boardCoordState :: Coord -> BoardState -> CoordState
- mapBoardCoords :: (Int -> Int -> CoordState -> a) -> BoardState -> [[a]]
- isValidMove :: BoardState -> Color -> Coord -> Bool
- isCurrentValidMove :: BoardState -> Coord -> Bool
- data Cursor = Cursor {}
- rootCursor :: Node -> Cursor
- cursorRoot :: Cursor -> Cursor
- cursorChild :: Cursor -> Int -> Cursor
- cursorChildren :: Cursor -> [Cursor]
- cursorChildCount :: Cursor -> Int
- cursorChildPlayingAt :: Coord -> Cursor -> Maybe Cursor
- cursorProperties :: Cursor -> [Property]
- cursorModifyNode :: (Node -> Node) -> Cursor -> Cursor
- cursorVariations :: VariationModeSource -> Cursor -> [(Coord, Color)]
- colorToMove :: Color -> Coord -> Property
Documentation
Properties that are specified in the root nodes of game trees.
Properties that are specified in game info nodes.
internalIsGameInfoNode :: Node -> BoolSource
Returns whether a node contains any game info properties.
data BoardState Source
An object that corresponds to a node in some game tree, and represents the state of the game at that node, including board position, player turn and captures, and also board annotations.
BoardState | |
|
boardWidth :: BoardState -> IntSource
Returns the width of the board, in stones.
boardHeight :: BoardState -> IntSource
Returns the height of the board, in stones.
data CoordState Source
Used by BoardState
to represent the state of a single point on the board.
Records whether a stone is present, as well as annotations and visibility
properties.
CoordState | |
|
boardCoordState :: Coord -> BoardState -> CoordStateSource
Returns the CoordState
for a coordinate on a board.
mapBoardCoords :: (Int -> Int -> CoordState -> a) -> BoardState -> [[a]]Source
Maps a function over each CoordState
in a BoardState
, returning a
list-of-lists with the function's values. The function is called like fn y
x coordState
.
isValidMove :: BoardState -> Color -> Coord -> BoolSource
Returns whether it is legal to place a stone of the given color at a point on a board. Accepts out-of-bound coordinates and returns false.
isCurrentValidMove :: BoardState -> Coord -> BoolSource
Returns whether it is legal for the current player to place a stone at a point on a board. Accepts out-of-bound coordinates and returns false.
A pointer to a node in a game tree that also holds information about the current state of the game at that node.
Cursor | |
|
rootCursor :: Node -> CursorSource
Returns a cursor for a root node.
cursorRoot :: Cursor -> CursorSource
cursorChild :: Cursor -> Int -> CursorSource
cursorChildren :: Cursor -> [Cursor]Source
cursorChildCount :: Cursor -> IntSource
cursorProperties :: Cursor -> [Property]Source
This is simply
.
nodeProperties
. cursorNode
cursorVariations :: VariationModeSource -> Cursor -> [(Coord, Color)]Source
colorToMove :: Color -> Coord -> PropertySource