Class: MissionStrategy::JobTypeStrategy

Inherits:
Object
  • Object
show all
Defined in:
app/models/mission_strategy.rb

Overview

This class describes a strategy of job type.

Defined Under Namespace

Classes: JobTypeBattleStrategy

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (JobTypeStrategy) initialize(symbol)

Initialize this class.

Parameters:

  • symbol (String)


66
67
68
69
# File 'app/models/mission_strategy.rb', line 66

def initialize(symbol)
  @job_type_symbol = symbol
  @battle_methods = Hash.new
end

Instance Attribute Details

- (Object) job_type_symbol

Returns the value of attribute job_type_symbol



14
15
16
# File 'app/models/mission_strategy.rb', line 14

def job_type_symbol
  @job_type_symbol
end

- (Object) retreat_hp_rate

Returns the value of attribute retreat_hp_rate



15
16
17
# File 'app/models/mission_strategy.rb', line 15

def retreat_hp_rate
  @retreat_hp_rate
end

- (Object) vpos

Returns the value of attribute vpos



16
17
18
# File 'app/models/mission_strategy.rb', line 16

def vpos
  @vpos
end

Instance Method Details

- (Object) battle(symbol)

Return the battle object of selected job type.

Parameters:

  • symbol (String)

Returns:

  • (Object)

    battle



74
75
76
77
# File 'app/models/mission_strategy.rb', line 74

def battle(symbol)
  @battle_methods[symbol] = JobTypeBattleStrategy.new(symbol) if @battle_methods[symbol].nil?
  return @battle_methods[symbol]
end