Esempio n. 1
0
        private Room GetNewRandomRoom()
        {
            int randomWidth;

            do
            {
                randomWidth = _dice.RollBetween(4, MaxRoomWidthBasedOnMaxDisplayWidth);
            } while (randomWidth % 2 != 0);

            int randomHeight;

            do
            {
                randomHeight = _dice.RollBetween(4, MaxRoomHeightBasedOnMaxDisplayHeight);
            } while (randomHeight % 2 != 0);

            var roomSize         = new Size(randomWidth, randomHeight);
            var startingPosition = new Position(1, 1);

            return(RoomFactory.CreateEmptyRoom(roomSize, startingPosition));
        }
Esempio n. 2
0
        private static Room GetNewRandomRoom()
        {
            int randomWidth;

            do
            {
                randomWidth = Dice.RollForRandomRoomWidth();
            } while (randomWidth % 2 != 0);

            int randomHeight;

            do
            {
                randomHeight = Dice.RollForRandomRoomHeight();
            } while (randomHeight % 2 != 0);

            var roomSize         = new Size(randomWidth, randomHeight);
            var startingPosition = new Position(1, 1);

            return(RoomFactory.CreateEmptyRoom(roomSize, startingPosition).WithRandomMonster());
        }