//testing for string color convert //https://code.4noobz.net/c-enum-color-converter-ivalueconverter/ //uses Enum values to assign color //PlayerXTurn, //PlayerOTurn, // public void ColorConverter () // //if GameboardState is NewRound color needs to equal grey-- default? //switch() //case PlayerXTurn: //color= new SolidColorBrush(Colors.Red); //break; //case PlayerOTurn: //color = new SolidColorBrush(Colors.Yellow); //break //default: //color= new SolidColorBrush(Colors.Gray); //break; //this won't target the fill /// <summary> /// Add player's move to the game board. /// </summary> /// <param name="gameboardPosition"></param> /// <param name="PlayerPiece"></param> public void SetPlayerPiece(GameboardPosition gameboardPosition, string PlayerPiece) { // // Row and column value adjusted to match array structure // Note: gameboardPosition converted to array index by subtracting 1 // CurrentBoard[gameboardPosition.Row][gameboardPosition.Column] = PlayerPiece; // // Change game board state to next player // SetNextPlayer(); }
/// <summary> /// Determine if the game board position is taken /// </summary> /// <param name="gameboardPosition"></param> /// <returns>true if position is open</returns> public bool GameboardPositionAvailable(GameboardPosition gameboardPosition) { // // Confirm that the board position is empty // Note: gameboardPosition converted to array index by subtracting 1 // if (CurrentBoard[gameboardPosition.Row][gameboardPosition.Column] == PLAYER_PIECE_NONE) { return(true); } else { return(false); } }
/// <summary> /// Determine if the game board position is taken /// </summary> /// <param name="gameboardPosition"></param> /// <returns>true if position is open</returns> public bool GameboardPositionAvailable(GameboardPosition gameboardPosition) { // // Confirm that the board position is empty // Note: gameboardPosition converted to array index by subtracting 1 // if (CurrentBoard[gameboardPosition.Row][gameboardPosition.Column] == EMPTY_BOARD_LOCATION_COLOR) { return(true); } else { return(false); } }