Esempio n. 1
0
        public static Boat Generate()
        {
            string     ID         = Boat.GetID("R");
            int        weight     = Boat.GetRandomValue(100, 300);
            int        speed      = Boat.GetRandomValue(1, 3);
            int        passengers = Boat.GetRandomValue(1, 6);
            RowingBoat R          = new RowingBoat(ID, weight, speed, 1, false, 1, passengers);

            return(R);
        }
Esempio n. 2
0
 public static void Moor(List <Boat> boats, Berth[] docks)
 {
     foreach (var boat in boats)
     {
         if (boat is RowingBoat)
         {
             RowingBoat.FindBerth(docks, boat);
         }
     }
 }
Esempio n. 3
0
 public static void GenerateBoats(int numberOfBoats, List <Boat> boats)
 {
     for (int i = 0; i < numberOfBoats; i++)
     {
         int TypeOfBoat = Boat.GetRandomValue(1, 1);
         switch (TypeOfBoat)
         {
         case 1:
             Boat r = RowingBoat.Generate();
             boats.Add(r);
             break;
         }
     }
 }