Exemple #1
0
 public void Run()
 {
     _mineMap = _mapFactory.GetMineMap();
     _simulationResults.Mines      = _mineMap.PlacedMines;
     _simulationResults.TotalBombs = _mineMap.TotalBombs;
     SquareSimulation();
     HexSimulation();
     // while(!squareTask.IsCompleted && !hexTask.IsCompleted){Thread.Sleep(500);}
 }
Exemple #2
0
        public void GenerateMaps(int x, int y, double minePercentage)
        {
            //convert to cm
            x *= 100;
            y *= 100;
            //calculate number of cells on x and y axis
            var xCellCount = (int)Math.Ceiling((decimal)(x) / 25);
            var yCellCount = (int)Math.Ceiling((decimal)(y) / 25);

            Width      = xCellCount;
            Height     = yCellCount;
            _squareMap = new SquareMap(xCellCount, yCellCount);
            _hexMap    = new HexMap(xCellCount, yCellCount);
            _mineMap   = new MineMap(xCellCount, yCellCount, minePercentage);
        }