Class: RubyWarrior::LevelLoader
- Inherits:
-
Object
- Object
- RubyWarrior::LevelLoader
- Defined in:
- lib/ruby_warrior/level_loader.rb
Instance Method Summary collapse
- #ace_score(score) ⇒ Object
- #clue(clue) ⇒ Object
- #description(desc) ⇒ Object
-
#initialize(level) ⇒ LevelLoader
constructor
A new instance of LevelLoader.
- #size(width, height) ⇒ Object
- #stairs(x, y) ⇒ Object
- #time_bonus(bonus) ⇒ Object
- #tip(tip) ⇒ Object
- #unit(unit, x, y, facing = :north) {|unit| ... } ⇒ Object
- #warrior(*args, &block) ⇒ Object
Constructor Details
#initialize(level) ⇒ LevelLoader
Returns a new instance of LevelLoader.
3 4 5 6 7 |
# File 'lib/ruby_warrior/level_loader.rb', line 3 def initialize(level) @floor = RubyWarrior::Floor.new @level = level @level.floor = @floor end |
Instance Method Details
#ace_score(score) ⇒ Object
25 26 27 |
# File 'lib/ruby_warrior/level_loader.rb', line 25 def ace_score(score) @level.ace_score = score end |
#clue(clue) ⇒ Object
17 18 19 |
# File 'lib/ruby_warrior/level_loader.rb', line 17 def clue(clue) @level.clue = clue end |
#description(desc) ⇒ Object
9 10 11 |
# File 'lib/ruby_warrior/level_loader.rb', line 9 def description(desc) @level.description = desc end |
#size(width, height) ⇒ Object
29 30 31 32 |
# File 'lib/ruby_warrior/level_loader.rb', line 29 def size(width, height) @floor.width = width @floor.height = height end |
#stairs(x, y) ⇒ Object
34 35 36 |
# File 'lib/ruby_warrior/level_loader.rb', line 34 def stairs(x, y) @floor.place_stairs(x, y) end |
#time_bonus(bonus) ⇒ Object
21 22 23 |
# File 'lib/ruby_warrior/level_loader.rb', line 21 def time_bonus(bonus) @level.time_bonus = bonus end |
#tip(tip) ⇒ Object
13 14 15 |
# File 'lib/ruby_warrior/level_loader.rb', line 13 def tip(tip) @level.tip = tip end |