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

Returns:

  • (Float)

    the current value of gun_energy



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

def gun_energy
  @gun_energy
end

#headingRTanque::Heading (readonly)

Returns the current value of heading

Returns:



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

def heading
  @heading
end

#healthFloat (readonly)

health of bot. if == 0, dead

Returns:

  • (Float)

    the current value of health



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

def health
  @health
end

#positionRTanque::Point (readonly)

Returns the current value of position

Returns:



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

Returns:

  • (Enumerator)

    the current value of radar



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

def radar
  @radar
end

#radar_headingRTanque::Heading (readonly)

Returns the current value of radar_heading

Returns:



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

def radar_heading
  @radar_heading
end

#speedFloat (readonly)

Returns the current value of speed

Returns:

  • (Float)

    the current value of speed



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

def speed
  @speed
end

#ticksInteger (readonly)

number of ticks, starts at 0

Returns:

  • (Integer)

    the current value of ticks



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

def ticks
  @ticks
end

#turret_headingRTanque::Heading (readonly)

Returns the current value of turret_heading

Returns:



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

def turret_heading
  @turret_heading
end