Chess Game
1.1.0
A full chess game for Unity
|
Reads / writes game notation. Supports algebraic and coordinate notations. More...
Public Types | |
enum | NotationType { Algebraic, Coordinate } |
Notationtypes, algrebraic = e4, bxd3, O-O etc. Coordinate: e2-e4 d1-c2 c3-h8 etc. More... | |
enum | FormatType { None, PGN } |
PGN format is the standard of chess. More... | |
Public Member Functions | |
cgNotation (cgBoard fromBoard) | |
Notates the a game from the provided board. More... | |
void | AddMove (cgSimpleMove move) |
Add a move to the list of moves. More... | |
void | AddMove (string move, NotationType notationType) |
Add a move based on a notation type. More... | |
string | writeFullNotation (NotationType type, FormatType formatType=FormatType.None) |
Writes the full game notation from the current moves stored in Moves list. More... | |
string | getLogFriendlyNotation () |
A slight adjustment to GetFullNotation, in which new lines are added to indent the text in an orderly fashion to be displayed to the player. More... | |
void | Read (string curgame) |
Read the notations in the provided string. More... | |
Public Attributes | |
List< cgSimpleMove > | moves = new List<cgSimpleMove>() |
All moves being notated More... | |
cgBoard | board |
Reads / writes game notation. Supports algebraic and coordinate notations.
|
strong |
PGN format is the standard of chess.
|
strong |
Notationtypes, algrebraic = e4, bxd3, O-O etc. Coordinate: e2-e4 d1-c2 c3-h8 etc.
cgNotation.cgNotation | ( | cgBoard | fromBoard | ) |
Notates the a game from the provided board.
fromBoard | The board containing all moves to be notated |
void cgNotation.AddMove | ( | cgSimpleMove | move | ) |
Add a move to the list of moves.
move |
void cgNotation.AddMove | ( | string | move, |
NotationType | notationType | ||
) |
Add a move based on a notation type.
move | the string representation of the move(e4, bxd3 or e2-e4 etc.) |
notationType |
string cgNotation.getLogFriendlyNotation | ( | ) |
A slight adjustment to GetFullNotation, in which new lines are added to indent the text in an orderly fashion to be displayed to the player.
void cgNotation.Read | ( | string | curgame | ) |
Read the notations in the provided string.
curgame | the string to decipher. |
string cgNotation.writeFullNotation | ( | NotationType | type, |
FormatType | formatType = FormatType.None |
||
) |
Writes the full game notation from the current moves stored in Moves list.
type | What notationtype should it be? |
formatType | Should it be PGN format or not? |
List<cgSimpleMove> cgNotation.moves = new List<cgSimpleMove>() |
All moves being notated