Class: RTanque::Bot::Brain

Inherits:
Object
  • Object
show all
Defined in:
lib/rtanque/bot/brain.rb

Overview

Commands the associated RTanque::Bot. This class should be inherited from and NAME and #tick! overridden.

See BrainHelper for a useful mixin

Sample bots:

Constant Summary

NAME =
'bot name'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (RTanque::Arena) arena (readonly)

Returns:



23
24
25
# File 'lib/rtanque/bot/brain.rb', line 23

def arena
  @arena
end

- (RTanque::Bot::Command) command



21
# File 'lib/rtanque/bot/brain.rb', line 21

attr_accessor :sensors, :command

- (RTanque::Bot::Sensors) sensors



21
22
23
# File 'lib/rtanque/bot/brain.rb', line 21

def sensors
  @sensors
end

Instance Method Details

- (Object) tick!

This method is abstract.

Main logic goes here

Get input from #sensors. See Sensors

Give output to #command. See Command



45
46
47
# File 'lib/rtanque/bot/brain.rb', line 45

def tick!
  # Sweet bot logic
end