Class: RubyWarrior::Abilities::Listen

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_warrior/abilities/listen.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/listen.rb', line 4

def description
  "Returns an array of all spaces which have units in them."
end

#performObject



8
9
10
11
12
# File 'lib/ruby_warrior/abilities/listen.rb', line 8

def perform
  @unit.position.floor.units.map do |unit|
    unit.position.space unless unit == @unit
  end.compact
end