public void PrintShipList(bool PrintCoordinates) { foreach (Ships CurrShip in this.MyShips) { CurrShip.PrintShipDetails(PrintCoordinates); } }
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); }
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); }