Пример #1
0
 public Scooter GetFirstScooter()
 {
     if (Scooters.Count() != 0)
     {
         return(Scooters.First());
     }
     else
     {
         return(null);
     }
 }
Пример #2
0
 public Scooter chooseScooterToRent()
 {
     /* int i = 0;
      * Scooter[] scooters = Scooters.ToArray<Scooter>();
      * Scooter sc = null;
      * do
      * {
      *   if (scooters[i].State == ScooterState.available)
      *   {
      *       sc = scooters[i];
      *   }
      *   else { i++; }
      * } while (sc == null && i < scooters.Length);
      * return sc;*/
     if (Scooters == null || Scooters.Count() == 0)
     {
         return(null);
     }
     return(Scooters.First());
 }
Пример #3
0
 public void DeleteFirstScooter(Scooter scooter)
 {
     Scooters.Remove(Scooters.First()); //ayuda esto o el objeto scooter
     scooter.StateInUse();
 }