Class: RubyWarrior::Abilities::DirectionOf

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_warrior/abilities/direction_of.rb

Instance Method Summary collapse

Methods inherited from Base

#damage, #initialize, #offset, #pass_turn, #space, #unit, #verify_direction

Constructor Details

This class inherits a constructor from RubyWarrior::Abilities::Base

Instance Method Details

#descriptionObject



4
5
6
# File 'lib/ruby_warrior/abilities/direction_of.rb', line 4

def description
  "Pass a Space as an argument, and the direction (:left, :right, :forward, :backward) to that space will be returned."
end

#perform(space) ⇒ Object



8
9
10
# File 'lib/ruby_warrior/abilities/direction_of.rb', line 8

def perform(space)
  @unit.position.relative_direction_of(space)
end