Class: JamesBond::Core::MissionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/james_bond/core/mission_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ MissionPool

Returns a new instance of MissionPool.



6
7
8
9
# File 'lib/james_bond/core/mission_pool.rb', line 6

def initialize(params={})
  @mission_list = params[:mission_list]
  build_mission_by_main_command
end

Instance Attribute Details

#mission_by_main_commandObject

Returns the value of attribute mission_by_main_command.



4
5
6
# File 'lib/james_bond/core/mission_pool.rb', line 4

def mission_by_main_command
  @mission_by_main_command
end

#mission_listObject

Returns the value of attribute mission_list.



4
5
6
# File 'lib/james_bond/core/mission_pool.rb', line 4

def mission_list
  @mission_list
end

Instance Method Details

#decide_mission(command) ⇒ Object



11
12
13
# File 'lib/james_bond/core/mission_pool.rb', line 11

def decide_mission(command)
  @mission_by_main_command[command.main_command]
end