Ejemplo n.º 1
0
 public static void addRowingBoat(BoatProperties b, BoatProperties[] rowingTxtArray)
 {
     for (int i = 0; i < rowingTxtArray.Length; i++)
     {
         if (b is RowingBoat)
         {
             if (b.ArrayPosition == i)
             {
                 rowingTxtArray[i] = b;
                 break;
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static void addBoat(BoatProperties b, BoatProperties[] boatArray)
 {
     for (int i = 0; i < boatArray.Length; i++)
     {
         if (b is RowingBoat)
         {
             if (b.ArrayPosition == i)
             {
                 boatArray[i] = b;
                 break;
             }
         }
         if (b is CargoShip)
         {
             if (b.ArrayPosition == i)
             {
                 boatArray[i] = b;
                 break;
             }
         }
         if (b is PowerBoat)
         {
             if (b.ArrayPosition == i)
             {
                 boatArray[i] = b;
                 break;
             }
         }
         if (b is Sailboat)
         {
             if (b.ArrayPosition == i)
             {
                 boatArray[i] = b;
                 break;
             }
         }
         if (b is Catamaran)
         {
             if (b.ArrayPosition == i)
             {
                 boatArray[i] = b;
                 break;
             }
         }
     }
 }