Class: RubyArena::Ai

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_arena/ai.rb

Direct Known Subclasses

Level0Ai, Level1Ai, Level2Ai, Level3Ai

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Ai

Returns a new instance of Ai.



5
6
7
8
# File 'lib/ruby_arena/ai.rb', line 5

def initialize(args)
  @robot = args.fetch(:robot)
  @command_parser = args.fetch(:command_parser)
end

Instance Attribute Details

#command_parserObject (readonly)

Returns the value of attribute command_parser.



3
4
5
# File 'lib/ruby_arena/ai.rb', line 3

def command_parser
  @command_parser
end

#robotObject (readonly)

Returns the value of attribute robot.



3
4
5
# File 'lib/ruby_arena/ai.rb', line 3

def robot
  @robot
end

Instance Method Details

#tickObject

Raises:



10
11
12
# File 'lib/ruby_arena/ai.rb', line 10

def tick
  raise NotImplementedError, 'Your robot should implement tick method'
end