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); }
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); }