Class: RubyWarrior::Units::Golem

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_warrior/units/golem.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#health, #position

Instance Method Summary collapse

Methods inherited from Base

#abilities, #add_abilities, #alive?, #bind, #bound?, #earn_points, #name, #next_turn, #perform_turn, #prepare_turn, #say, #take_damage, #unbind

Instance Attribute Details

#max_healthObject

Returns the value of attribute max_health.



5
6
7
# File 'lib/ruby_warrior/units/golem.rb', line 5

def max_health
  @max_health
end

#turn=(value) ⇒ Object (writeonly)

Sets the attribute turn

Parameters:

  • value

    the value to set the attribute turn to.



4
5
6
# File 'lib/ruby_warrior/units/golem.rb', line 4

def turn=(value)
  @turn = value
end

Instance Method Details

#attack_powerObject



11
12
13
# File 'lib/ruby_warrior/units/golem.rb', line 11

def attack_power
  3
end

#characterObject



15
16
17
# File 'lib/ruby_warrior/units/golem.rb', line 15

def character
  "G"
end

#play_turn(turn) ⇒ Object



7
8
9
# File 'lib/ruby_warrior/units/golem.rb', line 7

def play_turn(turn)
  @turn.call(turn) if @turn
end