Exemple #1
0
 public HeavyUnit(HeavyUnit unit)
 {
     Health  = unit.Health;
     Attack  = unit.Attack;
     Defence = unit.Defence;
     Cost    = unit.Cost;
     Name    = unit.Name;
 }
Exemple #2
0
 public Proxy(HeavyUnit unit)
 {
     heavyUnit = unit;
     Health    = unit.Health;
     Attack    = unit.Attack;
     Defence   = unit.Defence;
     Cost      = unit.Cost;
     Name      = unit.Name;
 }
Exemple #3
0
        public IUnit DoSpecialAction(IUnit unit)
        {
            HeavyUnit heavy = unit as HeavyUnit;

            if (heavy == null)
            {
                return(null);
            }

            if (heavy.Horse && heavy.Shield && heavy.Pike && heavy.Helmet)
            {
                return(null);
            }

            switch (Rand.Get(0, 4))
            {
            case 0:
                if (!heavy.Horse)
                {
                    heavy.Horse = true;
                    return(new HorseDecorator(unit));
                }
                break;

            case 1:
                if (!heavy.Shield)
                {
                    heavy.Shield = true;
                    return(new ShieldDecorator(unit));
                }
                break;

            case 2:
                if (!heavy.Pike)
                {
                    heavy.Pike = true;
                    return(new PikeDecorator(unit));
                }
                break;

            case 3:
                if (!heavy.Helmet)
                {
                    heavy.Helmet = true;
                    return(new HelmetDecorator(unit));
                }
                break;

            default:
                break;
            }
            return(null);
        }