Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
game_piece.hpp File Reference

Defines GamePiece and supporting constants and free functions. More...

#include <cmath>
#include <string>
#include <unordered_map>
Include dependency graph for game_piece.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gameboard::GamePiece
 A Xiangqi game piece described by its gameboard::PieceType and its gameboard::PieceColor. More...
 

Namespaces

namespace  gameboard
 Tracking piece positions and determining legal moves.
 

Enumerations

enum  gameboard::PieceType : int {
  gameboard::kNnn = 0 , gameboard::kGen = 1 , gameboard::kAdv = 2 , gameboard::kEle = 3 ,
  gameboard::kHor = 4 , gameboard::kCha = 5 , gameboard::kCan = 6 , gameboard::kSol = 7
}
 
enum  gameboard::PieceColor : int { gameboard::kRed = -1 , gameboard::kNul = 0 , gameboard::kBlk = 1 }
 

Functions

size_t gameboard::GetZColorIndexOf (PieceColor color)
 
PieceColor gameboard::GetPieceColorOf (size_t zcolor_index)
 

Variables

const int gameboard::kNumPieceTypeVals = 8
 
const unordered_map< string, PieceType > gameboard::kPieceTypeStringToEnum
 
const int gameboard::kNumPieceColorVals = 3
 
const unordered_map< string, PieceColor > gameboard::kPieceColorStringToEnum
 

Detailed Description

Defines GamePiece and supporting constants and free functions.

Definition in file game_piece.hpp.