Exemplo n.º 1
0
        static public void Run()
        {
            Console.WriteLine("------------Prototype------------");
            Unit    unit;
            Warrior warrior = new Warrior(-10, 15);

            unit = warrior.Clone();
            unit.Info();

            Archer archer = new Archer(4, 9);

            unit = archer.Clone();
            unit.Info();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var Warrior1 = new Warrior(new Weapon("Super knife 1"));
            var Warrior3 = new Warrior(new Weapon("Bowl"));
            var Warrior4 = new Warrior(new Weapon("Magic staff"));

            Logger.Instance.Info("----------------------------Warrior 1----------------------------");
            Warrior1.Print();
            var Warrior2 = Warrior1.Clone();

            Logger.Instance.Info("----------------------------Warrior 2 cloned from Warrior 1------");
            Warrior2.Print();
            Logger.Instance.Info("----------------------------Warrior 3----------------------------");
            Warrior3.Print();
            Logger.Instance.Info("----------------------------Warrior 4----------------------------");
            Warrior4.Print();
        }