public IncommingMissiles(Sea sea, IEnumerable <Missile> missiles)
 {
     TheSea    = sea;
     Missiles  = missiles;
     Chance    = new Chance(1, 3);
     Challenge = new Challenge();
 }
        public GameEngine(IUpdateable form)
        {
            TheSea    = new Sea();
            ViewModel = new ViewModel(this.TheSea, form);

            Turns       = new List <Turn>();
            CurrentTurn = new NoTurn(new List <BattleShip>(), TheSea, ViewModel);
        }
Example #3
0
        public Turn(IEnumerable <BattleShip> BattleShips, Sea sea, ViewModel viewModel)
        {
            Randomizer    = new Random();
            FiredMissiles = new List <Missile>();

            this.BattleShips = new List <BattleShip> (BattleShips);
            this.TheSea      = sea;
            this.ViewModel   = viewModel;
        }
Example #4
0
        public ViewModel(Sea Sea, IUpdateable form)
        {
            TheSea = Sea;

            Form = form;

            BackgroundLayer = new BackgroundLayer();
            SeaBottomLayer  = new SeaBottomLayer(this.TheSea);
            SeaSurfaceLayer = new SeaSurfaceLayer(this.TheSea);
            AnimationLayer  = new AnimationLayer();
        }
Example #5
0
        public void Recalculate()
        {
            this.Clear();

            IEnumerable <BattleShip> sunkShips = this.TheSea.GetAllSunkShips();

            IEnumerable <ICoordinate> coordinates = Sea.GetAllCoordinatesFrom(sunkShips);

            foreach (ICoordinate coordinate in coordinates)
            {
                this.AddDisplayValue(coordinate.GetX(), coordinate.GetY(), SunkShipValue);
            }
        }
Example #6
0
 public SailAway(BattleShip ship, Sea sea)
 {
     Ship   = ship;
     TheSea = sea;
 }
Example #7
0
 public SeaBottomLayer(Sea sea)
 {
     this.TheSea = sea;
 }
Example #8
0
 public NoTurn(IEnumerable <BattleShip> BattleShips, Sea sea, ViewModel viewModel) :
     base(BattleShips, sea, viewModel)
 {
 }
 public CollisionDetection(Sea sea, BattleShip ship)
 {
     TheSea      = sea;
     OwnLocation = ship.GetLocation();
 }
 public SeaSurfaceLayer(Sea sea)
 {
     this.TheSea = sea;
 }