Пример #1
0
        public void MoveShip(IKapitein captain)
        {
            Location from = Ship.GetLocation();

            Location to = GetNewLocation(from, captain);

            if (IsNewLocationValid(to, Ship))
            {
                Ship.SetLocation(to);
            }
        }
Пример #2
0
        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();
 }