コード例 #1
0
        public void ShowModelOfFireCompany()
        {
            var joe = new Firefighter() { Name = "Joe" };
            var frank = new Firefighter() { Name = "Frank" };

            var truckOne = new Firetruck();
            truckOne.Driver = frank;

            var bigChiefHarry = new FireChief { Name = "Harry" };
            truckOne.Driver = bigChiefHarry;
            bigChiefHarry.Drive(truckOne, new Point(100, 300));
            bigChiefHarry.TellFirefighterToExtingushFire(joe);

            joe.ExtinguishFire();
            var bill = new TraineeFirefighter { Name = "Bill" };
            bill.ExtinguishFire();

            var station = new FireStation();
            var author = new Administrator
            {
                Title = "Mr",
                Forename = "Author",
                Surname = "Askey"
            };

            station.ClockIn(joe);
            station.ClockIn(bill);
            station.ClockIn(bigChiefHarry);
            station.ClockIn(author);

            station.RollCall();

            Console.ReadKey();
        }
コード例 #2
0
 public void TellFirefighterToExtingushFire(Firefighter colleage)
 {
     colleage.ExtinguishFire();
 }