public void TowerCreateMageTest()
        {
            _sut = new MageCreator(1, 10, "Offensive");

            tower = _sut.createTower();

            Assert.Equal(10, tower.GetDamage());
        }
        public void TowerCreateBankTest()
        {
            _sut = new BankCreator(10, "Offensive");

            tower = _sut.createTower();

            Assert.Equal(10, tower.GetMoney());
        }
コード例 #3
0
        public void TowerMoneyUpTest()
        {
            _sut = new BankCreator(10, "Offensive");

            tower = _sut.createTower();

            MoneyUpgrade towerMoneyUp = new MoneyUpgrade(tower);

            Assert.Equal(1010, towerMoneyUp.GetMoney());
        }
コード例 #4
0
        public void TowerRangeUpTest()
        {
            _sut = new BomberCreator(1, 10, "Offensive");

            tower = _sut.createTower();

            RangeUpgrade towerRangeUp = new RangeUpgrade(tower);

            Assert.Equal(11, towerRangeUp.GetRange());
        }
コード例 #5
0
        public void TowerDamageUpTest()
        {
            _sut = new BomberCreator(1, 10, "Offensive");

            tower = _sut.createTower();

            DamageUpgrade towerDmgUp = new DamageUpgrade(tower);

            Assert.Equal(120, towerDmgUp.GetDamage());
        }
コード例 #6
0
ファイル: InputHandler.cs プロジェクト: apofisz1/CSharpp
    public void createTower(string tower)
    {
        if (gameMenu.currentSelectedTower != null)
        {
            gameMenu.currentSelectedTower.deSelected();
        }

        selectedTower = towerInfo.getTowerGameObject(tower);
        int towerCost = TowerInfo.getTowerCost(tower);

        int curMoney = gameManager.getCurMoney();

        if (curMoney - towerCost >= 0)
        {
            towerCreator.createTower(selectedTower);
        }
        else
        {
            // TODO: Display error info on menu!
        }
    }