public void AddPlayerToken(bool isRed, IntVector2 boardPosition) {
if (! IsValidBoardPosition(boardPosition)) {
Debug.LogErrorFormat("Invalid coordinates to add a {0} token to the board: {1}", isRed ? "red" : "black", boardPosition);
return;
}
// create the token
GameObject tokenPrefab = isRed ? redPiecePrefab : blackPiecePrefab;
GameObject token = Instantiate<GameObject>(tokenPrefab);
// add to the scene
GameObject tile = board[boardPosition.x, boardPosition.y];
token.transform.SetParent(tile.transform, false);
// update board state
boardStates[boardPosition.x, boardPosition.y] = isRed ? BoardState.RED : BoardState.BLACK;
}