Class: Ship
Instance Attribute Summary
Attributes inherited from Unit
#cargo, #faction, #function, #x, #y
Instance Method Summary collapse
- #can_sail? ⇒ Boolean
-
#initialize(x, y, faction, map, infopane) ⇒ Ship
constructor
A new instance of Ship.
Methods inherited from Unit
#can_build?, #can_fly?, #can_move, #can_ride?, #can_transport?, #capture, #check_movement, #destroy, #draw, #function!, #info, #is_transporting?, #reset_moves, #set_function, #tile_check, #to_s, #update
Constructor Details
#initialize(x, y, faction, map, infopane) ⇒ Ship
Returns a new instance of Ship.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ship.rb', line 4 def initialize(x, y, faction, map, infopane) super dir_path = File.dirname(__FILE__) @image = Gosu::Image.new(dir_path + '/media/ship.png') @name = 'ship' @value = 10 @armor_left = @armor_max = 1 @moves_max = 2 @cargo_max = 3 end |
Instance Method Details
#can_sail? ⇒ Boolean
16 17 18 |
# File 'lib/ship.rb', line 16 def can_sail? true end |