Class: RTanque::Bot::Radar::Reflection
- Inherits:
-
Struct
- Object
- Struct
- RTanque::Bot::Radar::Reflection
- Defined in:
- lib/rtanque/bot/radar.rb
Overview
A Reflection is the information obtained for a bot detected by RTanque::Bot::Radar
Instance Attribute Summary collapse
-
#distance ⇒ Float
readonly
The current value of distance.
-
#heading ⇒ RTanque::Heading
readonly
The current value of heading.
-
#name ⇒ String
readonly
The current value of name.
Class Method Summary collapse
Instance Attribute Details
#distance ⇒ Float (readonly)
Returns the current value of distance.
15 16 17 |
# File 'lib/rtanque/bot/radar.rb', line 15 def distance @distance end |
#heading ⇒ RTanque::Heading (readonly)
Returns the current value of heading.
15 16 17 |
# File 'lib/rtanque/bot/radar.rb', line 15 def heading @heading end |
#name ⇒ String (readonly)
Returns the current value of name.
15 16 17 |
# File 'lib/rtanque/bot/radar.rb', line 15 def name @name end |
Class Method Details
.new_from_points(from_position, to_position, &tap) ⇒ Object
16 17 18 |
# File 'lib/rtanque/bot/radar.rb', line 16 def self.new_from_points(from_position, to_position, &tap) self.new(from_position.heading(to_position), from_position.distance(to_position)).tap(&tap) end |