Class: RTanque::Bot::Sensors

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

Overview

Sensors provide input to the Brain about the current state of the Match

They are made available to Brain via Brain#sensors

Instance Attribute Summary collapse

Instance Attribute Details

#gun_energyFloat (readonly)

energy of cannon. if < 0, cannot fire



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def gun_energy
  @gun_energy
end

#headingRTanque::Heading (readonly)



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def heading
  @heading
end

#healthFloat (readonly)

health of bot. if == 0, dead



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def health
  @health
end

#positionRTanque::Point (readonly)



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def position
  @position
end

#radarEnumerator (readonly)

enumerates all bots scanned by the radar, yielding Radar::Reflection



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def radar
  @radar
end

#radar_headingRTanque::Heading (readonly)



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def radar_heading
  @radar_heading
end

#speedFloat (readonly)



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def speed
  @speed
end

#ticksInteger (readonly)

number of ticks, starts at 0



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def ticks
  @ticks
end

#turret_headingRTanque::Heading (readonly)



16
17
18
# File 'lib/rtanque/bot/sensors.rb', line 16

def turret_heading
  @turret_heading
end