Class: Ledmon::Monster::Executor
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Movement
#distance, #get_heading, #get_position, #mapWalkable, #move_backward, #move_forward, #path_to, #tileId, #turn_left, #turn_right, #turn_towards, #update_movement
#accept_trade_offer, #attack, #cancel_trade_offer, #consume_item, #craft, #create_trade_offer, #equip_item, #get_health, #get_inventory, #get_recipes, #get_remaining_consumable_duration, #get_research_progress, #interact, #list_trade_offers, #look, #research, #scrap, #storage_list, #storage_transfer, #unequip_item
Methods included from Terminal
#prompt, #safe_prompt
Methods included from Session
#session_connect!, #session_grpc_host, #set_avatar
Constructor Details
#initialize(mode: :client) ⇒ Executor
Returns a new instance of Executor.
11
12
13
14
15
16
|
# File 'lib/ledmon/monster/executor.rb', line 11
def initialize(mode: :client)
@mode = mode
@logger = Logger.new(STDERR)
logger.level = Ledmon::Config.log_level.to_sym
end
|
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
9
10
11
|
# File 'lib/ledmon/monster/executor.rb', line 9
def logger
@logger
end
|
#mode ⇒ Object
Returns the value of attribute mode.
8
9
10
|
# File 'lib/ledmon/monster/executor.rb', line 8
def mode
@mode
end
|
Instance Method Details
#algo(id, input) ⇒ Object
32
33
34
|
# File 'lib/ledmon/monster/executor.rb', line 32
def algo(id, input)
raise Ledmon::Error, "#{__method__} is not implemented!"
end
|
#algo_result(result, id, input, output) ⇒ Object
36
37
38
|
# File 'lib/ledmon/monster/executor.rb', line 36
def algo_result(result, id, input, output)
raise Ledmon::Error, "#{__method__} is not implemented!"
end
|
#avatar ⇒ Object
24
25
26
|
# File 'lib/ledmon/monster/executor.rb', line 24
def avatar
raise Ledmon::Error, "#{__method__} is not implemented!"
end
|
#brain ⇒ Object
28
29
30
|
# File 'lib/ledmon/monster/executor.rb', line 28
def brain
raise Ledmon::Error, "#{__method__} is not implemented!"
end
|
#client? ⇒ Boolean
46
47
48
|
# File 'lib/ledmon/monster/executor.rb', line 46
def client?
mode == :client
end
|
#server? ⇒ Boolean
42
43
44
|
# File 'lib/ledmon/monster/executor.rb', line 42
def server?
mode == :server
end
|
#setup ⇒ Object
18
19
20
|
# File 'lib/ledmon/monster/executor.rb', line 18
def setup
session_connect!
end
|