Exemplo n.º 1
0
        private Coordinate RandomCoordinates(RoomBlocks blocks)
        {
            Coordinate point;

            do
            {
                point = new Coordinate(
                    _randomNumberGenerator.Dice(blocks.RowUpperBound),
                    _randomNumberGenerator.Dice(blocks.ColumnUpperBound)
                    );
            } while (!blocks.IsInside(point));

            return(point);
        }
Exemplo n.º 2
0
        private Coordinate RandomWalkCoordinates(RoomBlocks blocks, Coordinate point)
        {
            Coordinate nextPoint;

            Compass4Points randomDirection;

            do
            {
                randomDirection = _randomNumberGenerator.Enum <Compass4Points>();
                nextPoint       = point.Move(randomDirection);
            } while (!blocks.IsInside(nextPoint));

            _logger.Debug($"From Point [{point}] go [{randomDirection.ToString()}] to [{nextPoint}]");

            return(nextPoint);
        }