public Boat(int i, double length) { _Length = length; _Boattype = (BoatCategory)i; }
public void UpdateBoat(double length, BoatCategory category, int id) { Boat boatToRegister = new Boat(length, category, id); foreach (Boat boat in m_boats) { if (boat.BoatId == boatToRegister.BoatId) { throw new InvalidOperationException("Boat is already registered"); } } m_boats.Add(boatToRegister); }
public void RegisterBoat(double length, BoatCategory category) { Random random = new Random(); int boatId = random.Next(0, 100); //Make sure member ID is unique while (true) { foreach (Boat boat in m_boats) { if (boat.BoatId == boatId) { continue; } } break; } Boat boatToRegister = new Boat(length, category, boatId); m_boats.Add(boatToRegister); }
public void Category(BoatCategory categoryType) { throw new NotImplementedException(); }
public Boat(double length, BoatCategory category, int id) { Category = category; Length = length; BoatId = id; }