Package com.barrybecker4.ca.dj.jigo.sgf
Class SGFGame
- java.lang.Object
-
- com.barrybecker4.ca.dj.jigo.sgf.SGFGame
-
public final class SGFGame extends java.lang.ObjectRepresents a full Go game; typically after having been parsed from an InputStream conforming to the SGF (Smart-Game Format) file standard.An SGFGame contains an SGFTree which houses every node (that is, a leaf) of the game. Leaves contain information such as moves, markup, and comments.
All tokens related to information about the game are also contained by this class. This makes the tokens easy to find and use (rather than making them part of the first leaf of the first sub-tree of the game).
Eventually this class will wrap the functionality for saving an SGF game, so the idea of allowing anyone add InfoTokens is valid (rather than keeping it protected in the family, so to speak).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInfoToken(InfoToken it)java.util.EnumerationgetInfoTokens()Returns the list of tokens that contain information about the SGF game in question.SGFTreegetTree()Returns the game tree, at its zeroth variation (i.e., root level).
-
-
-
Constructor Detail
-
SGFGame
public SGFGame(SGFTree tree)
Creates a new SGFGame given a tree which comprises the game's nodes (and sub-trees representing variations).- Parameters:
tree- - The root tree for this SGFGame.
-
-
Method Detail
-
getTree
public SGFTree getTree()
Returns the game tree, at its zeroth variation (i.e., root level).- Returns:
- An SGFTree which contains all moves played in the game.
-
addInfoToken
public void addInfoToken(InfoToken it)
-
getInfoTokens
public java.util.Enumeration getInfoTokens()
Returns the list of tokens that contain information about the SGF game in question.- Returns:
- An Enumeration filled with type com.barrybecker4.ca.dj.jigo.sgf.tokens.InfoToken.
-
-