Пример #1
0
 public Unit()
 {
     SoldierCount = DefaultSoldierCount;
     TotalSoldierCount = DefaultSoldierCount;
     TotalMorale = DefaultMorale;
     CurrentMorale = DefaultMorale;
     Armor = new Armor();
     Weapon = new Weapon();
     CommanderName = NameGenerator.GenerateName(Species.Human);
     ran = new Random();
 }
Пример #2
0
 public Unit(Int32 iSoldierCount, Int32 iTotalMorale, Weapon wWeapon, Armor aArmor)
 {
     this.SoldierCount = iSoldierCount;
     this.TotalSoldierCount = iSoldierCount;
     this.TotalMorale = iTotalMorale;
     this.CurrentMorale = iTotalMorale;
     Weapon = wWeapon;
     Armor = aArmor;
     CommanderName = NameGenerator.GenerateName(Species.Human);
     ran = new Random();
 }
Пример #3
0
        //Cause this unit to route
        public void Route()
        {
            Weapon = new Weapon();
            Armor = new Armor();

            if (!IsRouting)
            {
                RecordLoss();
            }

            IsRouting = true;
            for (int i = 0; i < CurrentOpponents.Count; i++)
            {
                Unit uUnit;
                uUnit = CurrentOpponents.ElementAt(i);
                uUnit.MoraleBonus();
                uUnit.RecordVictory();
                uUnit.CurrentOpponents.Remove(this);
            }
            CurrentOpponents.Clear();
        }