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(); }
public void Drive(Firetruck tructToDrive, Point coordinates) { if (tructToDrive.Driver != this) return; tructToDrive.Drive(coordinates); }