예제 #1
0
        public void Initialize(Coordinate maxCoords, Ship[] startingShips)
        {
            this.Ships = startingShips;
            this.MaxCoords = maxCoords;
            this.Attacks = new Attack[maxCoords.X + 1, maxCoords.Y + 1];
            for (int x = 0; x <= maxCoords.X; x++) { for (int y = 0; y <= maxCoords.Y; y++) { Attacks[x, y] = new Attack(); } }
            this.sph = new ShipPlacementHelper(maxCoords);
            this.gih = new GameInfoHelper();

            this.resetShips.IsEnabled = false;
            this.resetShips.Visibility = Visibility.Hidden;

            InitializeGrids();
            InitializeShips();
            InitializePlayerInfo();
        }
예제 #2
0
 public virtual void Initialize(Coordinate maxCoords, Ship[] startingShips)
 {
     this.Ships = startingShips;
     this.Attacks = new Attack[maxCoords.X + 1, maxCoords.Y + 1];
     for (int x = 0; x <= maxCoords.X; x++) { for (int y = 0; y <= maxCoords.Y; y++) { Attacks[x, y] = new Attack(); } }
     this.MaxCoords = maxCoords;
     this.sph = new ShipPlacementHelper(maxCoords);
 }