CallsDispatcher Class
Method Index
- actionInterruptHandler(action, humanoid)
- addChangeCallback(callback, self_value)
- answerCall(staff)
- callForRepair(object, urgent, manual, lock_room)
- callForStaff(room)
- callForStaffEachRoom(room, attribute, key)
- callForWatering(plant)
- dropFromQueue(object, key)
- dump()
- dumpCall(call, message)
- enqueue(object, key, description, verification, priority, execute)
- executeCall(call, staff)
- findSuitableStaff(call)
- getPriorityForRoom(room, attribute, staff)
- onChange()
- onCheckpointCompleted(call)
- onTick()
- queueCallCheckpointAction(humanoid, interrupt_handler)
- removeChangeCallback(callback)
- sendStaffToRepair(object, handyman)
- sendStaffToRoom(room, staff)
- sendStaffToWatering(plant, handyman)
- staffActionInterruptHandler(action, humanoid, high_priority)
- unassignCall(call)
- verifyStaffForRoom(room, attribute, staff)
Member Index
- call_queue
- change_callback
- tick
- world
function CallsDispatcher:CallsDispatcher(world, entities)
Turn on for debug message
Parameters:
Name | Type | Description |
---|---|---|
world | ? | ? |
entities | ? | ? |
Declared on: line 23 of Lua/calls_dispatcher.lua.
function CallsDispatcher.actionInterruptHandler(action, humanoid)
Default checkpoint interrupt handler
Reset the assigned status, and find an replacement staff
Parameters:
Name | Type | Description |
---|---|---|
action | ? | ? |
humanoid | ? | ? |
Declared on: line 310 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher:addChangeCallback(callback, self_value)
Parameters:
Name | Type | Description |
---|---|---|
callback | ? | ? |
self_value | ? | ? |
Declared on: line 36 of Lua/calls_dispatcher.lua.
function CallsDispatcher:answerCall(staff)
Find the best call for a staff to work on.
When a staff goes to meandering mode, it should call this function to look for new call
Return true if a call is answered. False if there is no suitable call waiting and the staff is really free.
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 222 of Lua/calls_dispatcher.lua.
function CallsDispatcher:callForRepair(object, urgent, manual, lock_room)
Call for repair
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
urgent | ? | Announcement should be made |
manual | ? | This call should not trigger advisor for "your machine is failing" |
lock_room | ? | This is a minor maintence. Rooms needed not to be locked. If urgent or manual is specified, lock_room will be true automatically |
Declared on: line 87 of Lua/calls_dispatcher.lua.
function CallsDispatcher:callForStaff(room)
Parameters:
Name | Type | Description |
---|---|---|
room | ? | ? |
Declared on: line 50 of Lua/calls_dispatcher.lua.
function CallsDispatcher:callForStaffEachRoom(room, attribute, key)
Parameters:
Name | Type | Description |
---|---|---|
room | ? | ? |
attribute | ? | ? |
key | ? | ? |
Declared on: line 66 of Lua/calls_dispatcher.lua.
function CallsDispatcher:callForWatering(plant)
Parameters:
Name | Type | Description |
---|---|---|
plant | ? | ? |
Declared on: line 136 of Lua/calls_dispatcher.lua.
function CallsDispatcher:dropFromQueue(object, key)
Drop any call associated with the object (and/or key).
Expected to be called when the call is no longer needed
(like a machine that needed repaired were replaced),
or when the object is destroyed, etc.
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
key | ? | ? |
Declared on: line 340 of Lua/calls_dispatcher.lua.
function CallsDispatcher:dump()
Dump the current call table for debugging
Declared on: line 269 of Lua/calls_dispatcher.lua.
function CallsDispatcher.dumpCall(call, message)
Parameters:
Name | Type | Description |
---|---|---|
call | ? | ? |
message | ? | ? |
Declared on: line 280 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher:enqueue(object, key, description, verification, priority, execute)
Enqueue the call
returns: True if the call is inserted and queued, but not served
False if the call is served right away, or has been queued and assigned
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
key | ? | ? |
description | ? | ? |
verification | ? | ? |
priority | ? | ? |
execute | ? | ? |
Declared on: line 158 of Lua/calls_dispatcher.lua.
function CallsDispatcher:executeCall(call, staff)
Parameters:
Name | Type | Description |
---|---|---|
call | ? | ? |
staff | ? | ? |
Declared on: line 330 of Lua/calls_dispatcher.lua.
function CallsDispatcher:findSuitableStaff(call)
Find suitable (best) staff for working on a specific call
True
Parameters:
Name | Type | Description |
---|---|---|
call | ? | ? |
Declared on: line 184 of Lua/calls_dispatcher.lua.
function CallsDispatcher.getPriorityForRoom(room, attribute, staff)
Parameters:
Name | Type | Description |
---|---|---|
room | ? | ? |
attribute | ? | ? |
staff | ? | ? |
Declared on: line 388 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.onCheckpointCompleted(call)
Called when a call is completed sucessfully
Parameters:
Name | Type | Description |
---|---|---|
call | ? | ? |
Declared on: line 320 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.queueCallCheckpointAction(humanoid, interrupt_handler)
Add checkpoint action
All call execution method should add this action in apporiate place to signify
the job is finished.
A interrupt handler could be supplied if special handling is needed.
If not, the default would be reinsert the call into the queue
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
interrupt_handler | ? | ? |
Declared on: line 297 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher:removeChangeCallback(callback)
Parameters:
Name | Type | Description |
---|---|---|
callback | ? | ? |
Declared on: line 40 of Lua/calls_dispatcher.lua.
function CallsDispatcher.sendStaffToRepair(object, handyman)
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
handyman | ? | ? |
Declared on: line 441 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.sendStaffToRoom(room, staff)
Parameters:
Name | Type | Description |
---|---|---|
room | ? | ? |
staff | ? | ? |
Declared on: line 419 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.sendStaffToWatering(plant, handyman)
Parameters:
Name | Type | Description |
---|---|---|
plant | ? | ? |
handyman | ? | ? |
Declared on: line 445 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.staffActionInterruptHandler(action, humanoid, high_priority)
Parameters:
Name | Type | Description |
---|---|---|
action | ? | ? |
humanoid | ? | ? |
high_priority | ? | ? |
Declared on: line 431 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.unassignCall(call)
Parameters:
Name | Type | Description |
---|---|---|
call | ? | ? |
Declared on: line 368 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.
function CallsDispatcher.verifyStaffForRoom(room, attribute, staff)
Parameters:
Name | Type | Description |
---|---|---|
room | ? | ? |
attribute | ? | ? |
staff | ? | ? |
Declared on: line 376 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.