Class: Natural20::MovementHelper::Movement

Inherits:
Object
  • Object
show all
Defined in:
lib/natural_20/concerns/movement_helper.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_locationsArray (readonly)

Returns:

  • (Array)


44
45
46
# File 'lib/natural_20/concerns/movement_helper.rb', line 44

def acrobatics_check_locations
  @acrobatics_check_locations
end

#athletics_check_locationsArray (readonly)

Returns:

  • (Array)


47
48
49
# File 'lib/natural_20/concerns/movement_helper.rb', line 47

def athletics_check_locations
  @athletics_check_locations
end

#budgetInteger (readonly)

Returns:

  • (Integer)


23
24
25
# File 'lib/natural_20/concerns/movement_helper.rb', line 23

def budget
  @budget
end

#impedimentSymbol (readonly)

Returns:

  • (Symbol)


26
27
28
# File 'lib/natural_20/concerns/movement_helper.rb', line 26

def impediment
  @impediment
end

#jump_budgetInteger (readonly)

Returns:

  • (Integer)


32
33
34
# File 'lib/natural_20/concerns/movement_helper.rb', line 32

def jump_budget
  @jump_budget
end

#jump_locationsArray (readonly)

Returns:

  • (Array)


38
39
40
# File 'lib/natural_20/concerns/movement_helper.rb', line 38

def jump_locations
  @jump_locations
end

#jump_start_locationsArray (readonly)

Returns:

  • (Array)


35
36
37
# File 'lib/natural_20/concerns/movement_helper.rb', line 35

def jump_start_locations
  @jump_start_locations
end

#land_locationsArray (readonly)

Returns:

  • (Array)


41
42
43
# File 'lib/natural_20/concerns/movement_helper.rb', line 41

def land_locations
  @land_locations
end

#movementArray (readonly)

Returns:

  • (Array)


29
30
31
# File 'lib/natural_20/concerns/movement_helper.rb', line 29

def movement
  @movement
end

Class Method Details

.emptyNatural20::Movement

Returns:

  • (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

#costInteger

Returns:

  • (Integer)


50
51
52
# File 'lib/natural_20/concerns/movement_helper.rb', line 50

def cost
  (@original_budget - @budget)
end