Class: SDC::MapConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/core/MapConfig.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(map_name) ⇒ MapConfig

Returns a new instance of MapConfig.



7
8
9
10
# File 'lib/core/MapConfig.rb', line 7

def initialize(map_name)
	@map_name = map_name
	@script = nil
end

Instance Attribute Details

#map_nameObject (readonly)

Returns the value of attribute map_name.



4
5
6
# File 'lib/core/MapConfig.rb', line 4

def map_name
  @map_name
end

#tileset_indexObject

Returns the value of attribute tileset_index.



5
6
7
# File 'lib/core/MapConfig.rb', line 5

def tileset_index
  @tileset_index
end

Instance Method Details

#run_scriptObject



18
19
20
# File 'lib/core/MapConfig.rb', line 18

def run_script
	@script&.call
end

#script(&block) ⇒ Object

TODO: Could be extended for multiple pages



14
15
16
# File 'lib/core/MapConfig.rb', line 14

def script(&block)
	@script = block
end