Esempio n. 1
0
        public void TestAddCoinMethod()
        {
            // Set up
            Coin.WhiteCoins = 0;
            Coin.BlackCoins = 0;

            Coin.AddCoin(true);

            // Only white gaines a coin
            Assert.AreEqual(1, Coin.WhiteCoins);
            Assert.AreEqual(0, Coin.BlackCoins);
        }
Esempio n. 2
0
    private void CapturePiece(Piece capturedPiece)
    {
        activeChessPieces.Remove(capturedPiece.gameObject);

        Destroy(capturedPiece.gameObject);

        if (capturedPiece.GetType() == typeof(King))
        {
            //End the game
            Application.Quit();
        }

        // Add additional coin for capture
        Coin.AddCoin(isWhiteTurn);
    }
Esempio n. 3
0
    private void TakeTurn(int x, int z)
    {
        if (allowedRelativeMoves[x, z])
        {
            MoveAPiece(x, z);
        }
        // If move is not allowed, unselect piece
        else
        {
            selectedPiece = null;
            BoardHighlights.Instance.HideHighlights();
            return;
        }

        // Update player's coins
        Coin.AddCoin(isWhiteTurn);

        // Pass turn and swap cameras
        isWhiteTurn         = !isWhiteTurn;
        WhiteCamera.enabled = !WhiteCamera.enabled;
        BlackCamera.enabled = !BlackCamera.enabled;
    }
Esempio n. 4
0
 public void Coin_AddMysteryCoin()
 {
     _coin = new Coin(1, 1, _level, _contentManager, true);
     _coin.AddCoin(_mario);
     Assert.AreEqual(_mario.Coins, 1);
 }
Esempio n. 5
0
 public void Coin_AddCoin()
 {
     _coin.AddCoin(_mario);
     Assert.AreEqual(_mario.Coins, 1);
 }