Exemplo n.º 1
0
        private static void Main()
        {
            var tank = new ImportedTank();
            var mechanic = new Mechanic();

            Console.WriteLine("Tank is broken: {0}", tank.IsBroken);
            mechanic.Repair(tank);
            Console.WriteLine("After repairs: {0}", tank.Health);
            Console.WriteLine("Enemy on the left! Turn turret!");
            for (var i = 0; i < 15; i++)
            {
                if (tank.Bullets.Count > 0)
                {
                    tank.Fire();
                    tank.Hit(10);
                    Console.WriteLine("Enemy hit! HP: {0}", tank.Health);
                }
            }
        }
Exemplo n.º 2
0
 public void Init()
 {
     _mechanic = new Mechanic();
 }