Class: Savage::Directions::PointTarget
- Inherits:
-
Savage::Direction
- Object
- Savage::Direction
- Savage::Directions::PointTarget
- Defined in:
- lib/savage/directions/point_target.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(x, y, absolute = true) ⇒ PointTarget
constructor
A new instance of PointTarget.
- #to_a ⇒ Object
Methods inherited from Savage::Direction
Methods included from Utils
Constructor Details
#initialize(x, y, absolute = true) ⇒ PointTarget
Returns a new instance of PointTarget.
7 8 9 10 |
# File 'lib/savage/directions/point_target.rb', line 7 def initialize(x, y, absolute=true) @target = Point.new(x,y) super(absolute) end |
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/savage/directions/point_target.rb', line 5 def target @target end |
Instance Method Details
#to_a ⇒ Object
12 13 14 |
# File 'lib/savage/directions/point_target.rb', line 12 def to_a [command_code, @target.x, @target.y] end |