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