public DefenseUnit(DefenseUnitTypes type, int count = 1)
 {
     switch (type)
     {
         case DefenseUnitTypes.Empty:
             this.type = type;
             this.count = 0;
             this.range = 0;
             this.price = 0;
             break;
         case DefenseUnitTypes.Chicken:
             this.type = type;
             this.count = count;
             this.range = GameRules.ChickenRange;
             this.price = GameRules.ChickenPrice;
             break;
         case DefenseUnitTypes.Mine:
             this.type = type;
             this.count = 1;
             this.range = 0;
             this.price = GameRules.MinePrice;
             break;
         default:
             break;
     }
 }
Exemple #2
0
 public void InsertDefenseUnit(int x, int y, DefenseUnitTypes unitType, int count = 1)
 {
     this[x, y] = new DefenseUnit(unitType, count);
     this.GoldSpentForDefense += this[x, y].Count * this[x, y].Price;
     if (unitType == DefenseUnitTypes.Mine)
     {
         this.MinesCount += count;
     }
 }