Ejemplo n.º 1
0
    private int ScoreUnfinishedBoard(BoardData p_board, Tiles p_currentPlayerTile)
    {
        // If there is an enemy check then this board is shitty
        if (p_board.GetMoveToWin(p_board.CurrentPlayer).Count > 0)
        {
            return(0);
        }

        int t_currentPlayerChecks = p_board.GetMoveToWin(p_board.CurrentPlayer ^ (Players)1).Count;

        if (t_currentPlayerChecks >= 2)
        {
            return((int)BoardScores.TERMINAL);
        }
        else
        {
            int t_ghostChecks = p_board.CountGhostChecks(p_currentPlayerTile);
            if (t_ghostChecks == 3)
            {
                return((int)BoardScores.TRIPLETRAP);
            }
            else if (t_ghostChecks == 2)
            {
                if (t_currentPlayerChecks > 0)
                {
                    return((int)BoardScores.EASYTRAP);
                }
                else
                {
                    return((int)BoardScores.DOUBLETRAP);
                }
            }
            else
            {
                if (t_currentPlayerChecks > 0)
                {
                    return((int)BoardScores.CHECK);
                }
                else if (p_board.IsCornerTile(p_currentPlayerTile))
                {
                    return((int)BoardScores.CORNER);
                }
                else
                {
                    return(0);
                }
            }
        }
    }
Ejemplo n.º 2
0
 public override TreeNode MakeDecision(BoardData p_boardData)
 {
     if (p_boardData.GetMoveToWin(p_boardData.CurrentPlayer ^ (Players)1).Count > 0)
     {
         return(m_trueNode);
     }
     else
     {
         return(m_falseNode);
     }
 }
Ejemplo n.º 3
0
 public override Move PerformAction(BoardData p_boardData)
 {
     return(p_boardData.GetMoveToWin(p_boardData.CurrentPlayer ^ (Players)1)[0]);
 }