コード例 #1
0
        public static bool IsValidJump(PlayerMove i_ParseMove, char i_CoinType, Board i_Board)
        {
            bool isValidJump = true;

            Square middleSquare   = i_ParseMove.calculateMiddleSquare();
            Square squareToLandOn = i_ParseMove.NextSquare;

            if (!i_Board.IsEmptyAtSquare(squareToLandOn) || !i_Board.IsSquareContainCoinByType(middleSquare, i_CoinType))
            {
                isValidJump = false;
            }

            return(isValidJump);
        }
コード例 #2
0
        public void EatCoin(PlayerMove i_CurrentMove)
        {
            Square squareToRemoveCoinFrom = i_CurrentMove.calculateMiddleSquare();

            m_Board[squareToRemoveCoinFrom.RowIndex, squareToRemoveCoinFrom.ColumnIndex] = null;
        }