public void EvolveToken_RowOfFive_TokenReplacedWithDitto()
 {
     _pokemonGrid[0, 0] = new DittoToken();
     _pokemonBoard.evolveToken(0, 0, 5);
     Assert.AreEqual(_pokemonGrid[0, 0], _pokemonBoard.NewPokemonGrid[0, 0]);
 }
 public void MarkDittoNulls_BothAreDitto_MarkFullRowAndColumnNullCalledOnSurroundingLocations()
 {
     int row = 1;
     int col = 1;
     _pokemonGrid[row, col] = new DittoToken();
     _pokemonGrid[row, col + 1] = new DittoToken();
     _mockBoard.PokemonGrid = _pokemonGrid;
     _mockBoard.Expect(g => g.markFullRowAndColumnAsNull(row - 1, col - 1));
     _mockBoard.Expect(g => g.markFullRowAndColumnAsNull(row, col));
     _mockBoard.Expect(g => g.markFullRowAndColumnAsNull(row + 1, col + 1));
     _mockBoard.Replay();
     _mockBoard.markDittoNulls(row, col, row, col + 1);
     _mockBoard.VerifyAllExpectations();
 }
 public void MarkDittoNulls_DittoIsSecondToken_MarkAllTokensOfSameTypeAsNullCalled()
 {
     _pokemonGrid[0, 1] = new DittoToken();
     _mockBoard.PokemonGrid = _pokemonGrid;
     _mockBoard.Expect(g => g.markAllTokensOfSameTypeAsNull(_pokemonGrid[0, 0]));
     _mockBoard.Replay();
     _mockBoard.markDittoNulls(0, 0, 0, 1);
     _mockBoard.VerifyAllExpectations();
 }
Example #4
0
 /// <summary>
 /// Based on the number of same tokens in a row or column, evolves the token at the given 
 /// location. 4 of the same evolves to the first evolution and awards 100 bonus points, 
 /// 5 to Ditto with 300 bonus points, and 6 to the second evolution with 600 bonus points. 
 /// </summary>
 /// <param name="row">The row of the token to evolve. </param>
 /// <param name="col">The column of the token to evolve. </param>
 /// <param name="numberOfSameTokens">The number of same tokens in a row or column</param>
 public virtual void evolveToken(int row, int col, int numberOfSameTokens)
 {
     IBasicPokemonToken movedToken = _pokemonGrid[row, col];
     if (3 < numberOfSameTokens)
     {
         OnPointsAdded((int)Math.Pow(2, numberOfSameTokens) * 10);
         switch (numberOfSameTokens)
         {
             case 4:
                 _newPokemonGrid[row, col] = movedToken.firstEvolvedToken();
                 break;
             case 5:
                 _newPokemonGrid[row, col] = new DittoToken();
                 break;
             default:
                 _newPokemonGrid[row, col] = movedToken.secondEvolvedToken();
                 break;
         }
     }
 }