public void MoveShip(IKapitein captain) { Location from = Ship.GetLocation(); Location to = GetNewLocation(from, captain); if (IsNewLocationValid(to, Ship)) { Ship.SetLocation(to); } }
public ICoordinate GetRandomShipCoordinate() { BattleShip ship = GetRandomShip(); IEnumerable <ICoordinate> coordinates = ship .GetLocation() .GetCoordinates(); ICoordinate coordinate = GetRadomItem(new List <ICoordinate>(coordinates)); return(coordinate); }
public CollisionDetection(Sea sea, BattleShip ship) { TheSea = sea; OwnLocation = ship.GetLocation(); }