Esempio n. 1
0
        private bool IsMonsterInRange(Monster monster, BuiltTower tower)
        {
            double distance = 100;

            if (monster.Position > 0)
            {
                distance = GetDistance(monster.XCoordinate, monster.YCoordinate, tower.xCoordinate, tower.yCoordinate);
            }

            return(distance < 4); //TODO: Pasiimti pagal tower tipa
        }
Esempio n. 2
0
        public void AddTower(int xCoordinate, int yCoordinate, string towerType, Tower tower)
        {
            BuiltTower builtTower = new BuiltTower
            {
                TowerType   = towerType,
                xCoordinate = xCoordinate,
                yCoordinate = yCoordinate,
                Damage      = tower.GetDamage(),
                Range       = tower.GetRange(),
                Id          = Towers.Count,
            };

            Towers.Add(builtTower);
            TowerCaretakers.Add(new TowerCaretaker {
                Mementos = new Stack <TowerMemento>(), Originator = builtTower
            });
        }