Class: Army

Inherits:
Unit show all
Defined in:
lib/lib/units/army.rb

Instance Attribute Summary

Attributes inherited from Unit

#armour_left, #cargo, #cargo_max, #faction, #function, #x, #y

Instance Method Summary collapse

Methods inherited from Unit

#attack!, #can_be_built?, #can_be_captured?, #can_build?, #can_fly?, #can_move?, #can_sail?, #can_transport?, #capture!, #check_movement, #destroy!, #draw, #engage!, #function!, #info, #is_full?, #is_terrain_suitable?, #is_transported?, #is_transporting?, #is_waiting_for_commands?, #reset_moves!, #set_function!, #to_s

Constructor Details

#initialize(x, y, faction, map, infopane) ⇒ Army



9
10
11
12
13
14
15
16
# File 'lib/lib/units/army.rb', line 9

def initialize(x, y, faction, map, infopane)
  super
  dir_path = File.dirname(__FILE__)
  @image = Gosu::Image.new(dir_path + '/../../media/army.png')

  @armour_left = @armour_max = 3
  @moves_max = 5
end

Instance Method Details

#can_capture?Boolean



22
23
24
# File 'lib/lib/units/army.rb', line 22

def can_capture?
  true
end

#can_ride?Boolean



18
19
20
# File 'lib/lib/units/army.rb', line 18

def can_ride?
  true
end