Class: RubyArena::Game
- Inherits:
-
Object
- Object
- RubyArena::Game
- Defined in:
- lib/ruby_arena/game.rb
Instance Attribute Summary collapse
-
#arena ⇒ Object
readonly
Returns the value of attribute arena.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Instance Method Summary collapse
- #game_over? ⇒ Boolean
-
#initialize(args) ⇒ Game
constructor
A new instance of Game.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Game
Returns a new instance of Game.
5 6 7 8 9 10 |
# File 'lib/ruby_arena/game.rb', line 5 def initialize(args) @arena = Arena.new @robot_files = args[:robot_files] @level = Level.new(args[:options][:level]) if args[:options][:level] add_robots_to_arena end |
Instance Attribute Details
#arena ⇒ Object (readonly)
Returns the value of attribute arena.
3 4 5 |
# File 'lib/ruby_arena/game.rb', line 3 def arena @arena end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/ruby_arena/game.rb', line 3 def level @level end |
Instance Method Details
#game_over? ⇒ Boolean
16 17 18 |
# File 'lib/ruby_arena/game.rb', line 16 def game_over? arena.game_over? end |
#run ⇒ Object
12 13 14 |
# File 'lib/ruby_arena/game.rb', line 12 def run gui.show end |