예제 #1
0
 public Scooter GetFirstScooter()
 {
     if (Scooters.Count() != 0)
     {
         return(Scooters.First());
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
        public void AddScooter(DateTime registerDate, ScooterState state, Station station)
        {
            Scooter scooter = new Scooter(registerDate, state);

            Scooters.Add(scooter);
            if (scooter.IsStateAvailable(state))
            {
                station.AddScooter(scooter);
                scooter.SetStation(station);
            }
        }
예제 #3
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());
 }
예제 #4
0
 public void removeScooter(Scooter sc)
 {
     Scooters.Remove(sc);
 }
예제 #5
0
 public void assignScooter(Scooter sc)
 {
     Scooters.Add(sc);
 }
예제 #6
0
 public void AddScooter(Scooter scooter)
 {
     Scooters.Add(scooter);
 }
예제 #7
0
 public void DeleteFirstScooter(Scooter scooter)
 {
     Scooters.Remove(Scooters.First()); //ayuda esto o el objeto scooter
     scooter.StateInUse();
 }