static void Main()
 {
     Marine M = new Marine();
     M.Move(5, 5);
     M.Attack(10, 10);
     M.Die();
 }
示例#2
0
        static void Main(string[] args)
        {
            Unit m1 = new Marine();

            m1._Recall += Marine_Recall;
            m1._Recall += Marine_Recall_Effect;
            m1.TakeDamage(30);
            m1.Move(1, 1);
            Console.WriteLine(m1);
            UseSpecialAbility((ISpecialUnit)m1, 3);

            Unit f1 = new Firebat();

            f1._Recall += Firebat_Recall;
            f1._Recall += Firebat_Recall_Effect;
            f1.TakeDamage(20);
            f1.Move(10, 10);
            Console.WriteLine(f1);

            Unit z1 = new Zealot();

            z1.TakeDamage(150);
            z1.Move(100, 100);
            Console.WriteLine(z1);

            Arbirter a1 = new Arbirter();

            a1.TakeDamage(10);
            a1.Move(5, 5);
            Console.WriteLine(a1);
            a1.Recall(10, 10);
            a1.Recall(10, 10);
            a1.Recall(10, 10);
        }
示例#3
0
        static void Main(string[] args)
        {
            // Marine
            Unit unit = new Marine(new MoveLand(), new Attack());

            unit.Move();
            unit.Attack();

            // Medic
            unit = new Medic(new MoveLand(), new NoAttack());
            unit.Move();
            unit.Attack();

            // Wrath
            unit = new Wrath(new MoveSky(), new Attack());
            unit.Move();
            unit.Attack();

            // Medic special attack
            unit = new Marine(new MoveLand(), new SpecialAttack());
            unit.Move();
            unit.Attack();

            Console.ReadKey();
        }