コード例 #1
0
ファイル: BoatList.cs プロジェクト: dv222bk/1DV607_Portfolio
 /// <summary>
 /// Add a boat to the boat list
 /// </summary>
 /// <param name="a_type">Boat.Type. Type of boat</param>
 /// <param name="a_length">double. The length of the boat</param>
 public void AddBoat(Boat.Type a_type, double a_length)
 {
     try
     {
         m_boats.Add(new Boat(a_type, a_length, GetUniqueBoatID()));
         SaveBoats();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #2
0
ファイル: BoatList.cs プロジェクト: dv222bk/1DV607_Portfolio
 /// <summary>
 /// Change a boats information
 /// </summary>
 /// <param name="a_boatID">int. The boats ID</param>
 /// <param name="a_type">Boat.Type. The type of boat</param>
 /// <param name="a_length">double. The length of the boat</param>
 public void ChangeBoatInfo(int a_boatID, Boat.Type a_type, double a_length)
 {
     try
     {
         foreach (Boat boat in m_boats)
         {
             if (boat.GetBoatID() == a_boatID)
             {
                 boat.SetType(a_type);
                 boat.SetLength(a_length);
                 SaveBoats();
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }