Пример #1
0
 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");
     }
 }
Пример #2
0
 public bool Is_Parked(GenericVehicle v)
 {
     if (car_parked == false)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Пример #3
0
 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");
     }
 }
Пример #4
0
 // 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");
     }
 }
Пример #5
0
 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");
     }
 }
Пример #6
0
 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");
     }
 }
Пример #7
0
 // 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");
     }
 }
Пример #8
0
 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");
     }
 }
Пример #9
0
 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");
     }
 }
Пример #10
0
 public void Honk(GenericVehicle v)
 {
     Console.WriteLine("Honk Honk\n");
 }
Пример #11
0
 public virtual void Drive(Object o, GenericVehicle v)
 {
     Console.WriteLine("This life form cannot drive a vehicle.\n");
 }