Class: Natural20::MovementHelper::Movement
- Inherits:
-
Object
- Object
- Natural20::MovementHelper::Movement
- Defined in:
- lib/natural_20/concerns/movement_helper.rb
Instance Attribute Summary collapse
- #acrobatics_check_locations ⇒ Array readonly
- #athletics_check_locations ⇒ Array readonly
- #budget ⇒ Integer readonly
- #impediment ⇒ Symbol readonly
- #jump_budget ⇒ Integer readonly
- #jump_locations ⇒ Array readonly
- #jump_start_locations ⇒ Array readonly
- #land_locations ⇒ Array readonly
- #movement ⇒ Array readonly
Class Method Summary collapse
Instance Method Summary collapse
- #cost ⇒ Integer
-
#initialize(movement, original_budget, acrobatics_check_locations, athletics_check_locations, jump_locations, jump_start_locations, land_locations, jump_budget, budget, impediment) ⇒ Movement
constructor
A new instance of Movement.
Constructor Details
#initialize(movement, original_budget, acrobatics_check_locations, athletics_check_locations, jump_locations, jump_start_locations, land_locations, jump_budget, budget, impediment) ⇒ Movement
Returns a new instance of Movement.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 4 def initialize(movement, original_budget, acrobatics_check_locations, athletics_check_locations, jump_locations, jump_start_locations, land_locations, jump_budget, budget, impediment) @jump_start_locations = jump_start_locations @athletics_check_locations = athletics_check_locations @jump_locations = jump_locations @land_locations = land_locations @jump_budget = jump_budget @movement = movement @original_budget = original_budget @acrobatics_check_locations = acrobatics_check_locations @impediment = impediment @budget = budget end |
Instance Attribute Details
#acrobatics_check_locations ⇒ Array (readonly)
44 45 46 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 44 def acrobatics_check_locations @acrobatics_check_locations end |
#athletics_check_locations ⇒ Array (readonly)
47 48 49 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 47 def athletics_check_locations @athletics_check_locations end |
#budget ⇒ Integer (readonly)
23 24 25 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 23 def budget @budget end |
#impediment ⇒ Symbol (readonly)
26 27 28 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 26 def impediment @impediment end |
#jump_budget ⇒ Integer (readonly)
32 33 34 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 32 def jump_budget @jump_budget end |
#jump_locations ⇒ Array (readonly)
38 39 40 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 38 def jump_locations @jump_locations end |
#jump_start_locations ⇒ Array (readonly)
35 36 37 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 35 def jump_start_locations @jump_start_locations end |
#land_locations ⇒ Array (readonly)
41 42 43 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 41 def land_locations @land_locations end |
#movement ⇒ Array (readonly)
29 30 31 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 29 def movement @movement end |
Class Method Details
.empty ⇒ Natural20::Movement
18 19 20 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 18 def self.empty Movement.new([], 0, [], [], [], [], [], 0, 0, :nil) end |
Instance Method Details
#cost ⇒ Integer
50 51 52 |
# File 'lib/natural_20/concerns/movement_helper.rb', line 50 def cost (@original_budget - @budget) end |