Class: MapTileGenerator
- Inherits:
-
Object
- Object
- MapTileGenerator
- Defined in:
- lib/map_tile_generator.rb
Instance Attribute Summary collapse
-
#height_perlin_generator ⇒ Object
readonly
Returns the value of attribute height_perlin_generator.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
-
#map_config ⇒ Object
readonly
Returns the value of attribute map_config.
-
#moist_perlin_generator ⇒ Object
readonly
Returns the value of attribute moist_perlin_generator.
-
#temp_perlin_generator ⇒ Object
readonly
Returns the value of attribute temp_perlin_generator.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(map:, height_perlin_generator: nil, moist_perlin_generator: nil, temp_perlin_generator: nil) ⇒ MapTileGenerator
constructor
A new instance of MapTileGenerator.
Constructor Details
#initialize(map:, height_perlin_generator: nil, moist_perlin_generator: nil, temp_perlin_generator: nil) ⇒ MapTileGenerator
Returns a new instance of MapTileGenerator.
9 10 11 12 13 14 15 |
# File 'lib/map_tile_generator.rb', line 9 def initialize(map:, height_perlin_generator: nil, moist_perlin_generator: nil, temp_perlin_generator: nil) @map = map @map_config = map.config @height_perlin_generator = height_perlin_generator || default_perlin_height_generator @moist_perlin_generator = moist_perlin_generator || default_perlin_moist_generator @temp_perlin_generator = temp_perlin_generator || default_perlin_temp_generator end |
Instance Attribute Details
#height_perlin_generator ⇒ Object (readonly)
Returns the value of attribute height_perlin_generator.
7 8 9 |
# File 'lib/map_tile_generator.rb', line 7 def height_perlin_generator @height_perlin_generator end |
#map ⇒ Object (readonly)
Returns the value of attribute map.
7 8 9 |
# File 'lib/map_tile_generator.rb', line 7 def map @map end |
#map_config ⇒ Object (readonly)
Returns the value of attribute map_config.
7 8 9 |
# File 'lib/map_tile_generator.rb', line 7 def map_config @map_config end |
#moist_perlin_generator ⇒ Object (readonly)
Returns the value of attribute moist_perlin_generator.
7 8 9 |
# File 'lib/map_tile_generator.rb', line 7 def moist_perlin_generator @moist_perlin_generator end |
#temp_perlin_generator ⇒ Object (readonly)
Returns the value of attribute temp_perlin_generator.
7 8 9 |
# File 'lib/map_tile_generator.rb', line 7 def temp_perlin_generator @temp_perlin_generator end |
Instance Method Details
#generate ⇒ Object
17 18 19 20 |
# File 'lib/map_tile_generator.rb', line 17 def generate puts "generating #{map_config.width} x #{map_config.height} tiles..." if map_config.verbose positive_quadrant_cartesian_plane end |