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

#arenaRTanque::Arena (readonly)



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

def arena
  @arena
end

#commandRTanque::Bot::Command



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

attr_accessor :sensors, :command

#sensorsRTanque::Bot::Sensors



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

def sensors
  @sensors
end

Instance Method Details

#tick!Object

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