Exemple #1
0
 public void PrintShipList(bool PrintCoordinates)
 {
     foreach (Ships CurrShip in this.MyShips)
     {
         CurrShip.PrintShipDetails(PrintCoordinates);
     }
 }
Exemple #2
0
        public Ships GetShipOnMapPos(int x, int y)
        {
            char MapAgenda = this.MyShipMap.GetMapField(x, y);

            if (MapAgenda == '~')
            {
                return(null);
            }
            if (MapAgenda == 'W')
            {
                return(null);
            }
            if (MapAgenda == '+')
            {
                return(null);
            }
            foreach (Ships CurrShip in this.MyShips)
            {
                if (MapAgenda == CurrShip.GetShipAgenda())
                {
                    if (CurrShip.MatchCoordinates(x, y))
                    {
                        return(CurrShip);
                    }
                }
            }
            return(null);
        }
Exemple #3
0
 public bool SetShipByID(int x, int y, int NewOrientation, int ID)
 {
     foreach (Ships CurrShip in this.MyShips)
     {
         if (CurrShip.GetID() == ID)
         {
             return(CurrShip.SetShipPosition(x, y, NewOrientation, this.MyShipMap));
         }
     }
     return(false);
 }