Class: Ship

Inherits:
Unit show all
Defined in:
lib/ship.rb

Instance Attribute Summary

Attributes inherited from Unit

#cargo, #faction, #function, #x, #y

Instance Method Summary collapse

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/ship.rb', line 16

def can_sail?
  true
end