Example #1
0
        public Tile[,] GenerateTiles()
        {
            var tiles = new Tile[_squareDimensions.Large, _squareDimensions.Height];

            for (var idxX = 0; idxX < _squareDimensions.Large; idxX++)
            {
                for (var idxY = 0; idxY < _squareDimensions.Height; idxY++)
                {
                    var point = new Point(idxX, idxY);
                    if (IsExitPoint(point))
                    {
                        tiles[idxX, idxY] = new ExitTitle(point);
                        continue;
                    }
                    if (IsMine(point))
                    {
                        tiles[idxX, idxY] = new MineTitle(point);
                        continue;
                    }
                    tiles[idxX, idxY] = new EmptyTitle(point);
                }
            }
            return(tiles);
        }
Example #2
0
        public void MineTile_returns_MineHit()
        {
            var t = new MineTitle(0, 0);

            Assert.AreEqual(t.StepIn(), MoveResult.MineHit);
        }