public Scooter GetFirstScooter() { if (Scooters.Count() != 0) { return(Scooters.First()); } else { return(null); } }
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); } }
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()); }
public void removeScooter(Scooter sc) { Scooters.Remove(sc); }
public void assignScooter(Scooter sc) { Scooters.Add(sc); }
public void AddScooter(Scooter scooter) { Scooters.Add(scooter); }
public void DeleteFirstScooter(Scooter scooter) { Scooters.Remove(Scooters.First()); //ayuda esto o el objeto scooter scooter.StateInUse(); }