public virtual void TurnOffVehicle(Object o, GenericVehicle v) { if (o.GetType() != typeof(Person)) { Console.WriteLine("This life form cannot drive a vehicle, none the less be able to turn off a vehicle.\n"); } }
public bool Is_Parked(GenericVehicle v) { if (car_parked == false) { return(false); } else { return(true); } }
public virtual void StartVehicle(Object o, GenericVehicle v) { if (o.GetType() == typeof(Person)) { v.TurnOnEngine(o, v); } else { Console.WriteLine("This life form cannot start a vehicle.\n"); } }
// VEHICLE FUNCTIONS public override void GetInVehicle(Object o, GenericVehicle v) { if (this.GetAwakeStatus() == true) { Console.WriteLine(this.GetFirstName() + " got in the car.\n"); } else { Console.WriteLine(this.GetFirstName() + " needs to be awake first.\n"); } }
public override void TurnOffVehicle(Object o, GenericVehicle v) { if (this.GetAwakeStatus() == true) { Console.WriteLine(this.GetFirstName() + " turned off the car.\n"); v.TurnOffEngine(o, v); } else { Console.WriteLine(this.GetFirstName() + " needs to be awake first.\n"); } }
public void TurnOnEngine(Object o, GenericVehicle v) { if (o.GetType() == typeof(Person)) { engine_running = true; StringBuilder sb = new StringBuilder(); sb.AppendFormat("The engine is now firing all {0} cylinders.\n", v.GetCylinders()); Console.WriteLine(sb); } else { Console.WriteLine("You need to be a person to drive a car.\n"); } }
// PERSON, and other objects since technically a Dog could get in a vehicle public virtual void GetInVehicle(Object o, GenericVehicle v) { if (o.GetType() == typeof(Person)) { Console.WriteLine("This will never be used\n"); } else if (o.GetType() == typeof(Life) || o.GetType() == typeof(Dog) || o.GetType() == typeof(Cat)) { Console.WriteLine("You can get in the car, but you cannot drive.\n"); } else { Console.WriteLine("You can get in the car, but I'm not too sure I want you to.\n"); } }
public override void Drive(Object o, GenericVehicle v) { if (this.GetAwakeStatus() == true) { if (v.engine_running == true) { Console.WriteLine("You are now driving.\n"); } else { Console.WriteLine("You cannot drive the vehicle without starting the vehicle.\n"); } } else { Console.WriteLine(this.GetFirstName() + " needs to be awake first.\n"); } }
public void TurnOffEngine(Object o, GenericVehicle v) { if (o.GetType() == typeof(Person)) { if (Is_Parked(v) == false) { Console.WriteLine("You're crazy, that'll ruin your car, mate\n"); } else { engine_running = false; StringBuilder sb = new StringBuilder(); sb.AppendFormat("The engine has now stopped firing all {0} cylinders.\n", v.GetCylinders()); Console.WriteLine(sb); } } else { Console.WriteLine("You need to be a human to turn off the car.\n"); } }
public void Honk(GenericVehicle v) { Console.WriteLine("Honk Honk\n"); }
public virtual void Drive(Object o, GenericVehicle v) { Console.WriteLine("This life form cannot drive a vehicle.\n"); }