class RubyArena::Level

Constants

LEVELS

Attributes

level[R]

Public Class Methods

new(level) click to toggle source
# File lib/ruby_arena/level.rb, line 32
def initialize(level)
  @level = level
  exit_if_level_is_not_defined
end

Public Instance Methods

options_for_cpu_robots() click to toggle source
# File lib/ruby_arena/level.rb, line 37
def options_for_cpu_robots
  LEVELS[level][:robots]
end
options_for_user_robot() click to toggle source
# File lib/ruby_arena/level.rb, line 41
def options_for_user_robot
  LEVELS[level][:user_robot_options]
end

Private Instance Methods

exit_if_level_is_not_defined() click to toggle source
# File lib/ruby_arena/level.rb, line 47
def exit_if_level_is_not_defined
  if LEVELS[level].nil?
    puts "Level is not defined"
    exit
  end
end