public Boat(int i, double length)
 {
     _Length   = length;
     _Boattype = (BoatCategory)i;
 }
 public Boat(int i, double length)
 {
     _Length = length;
     _Boattype = (BoatCategory)i;
 }
示例#3
0
文件: Member.cs 项目: henceee/1DV607
        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);
        }
示例#4
0
文件: Member.cs 项目: henceee/1DV607
        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);
        }
示例#5
0
 public void Category(BoatCategory categoryType)
 {
     throw new NotImplementedException();
 }
示例#6
0
文件: Boat.cs 项目: henceee/1DV607
 public Boat(double length, BoatCategory category, int id)
 {
     Category = category;
     Length = length;
     BoatId = id;
 }