CorsixTH Lua Documentation

CallsDispatcher Class

Declared on: line 25 of Lua/calls_dispatcher.lua.

Method Index

Member Index

function CallsDispatcher:CallsDispatcher(world)

Turn on for debug message

Parameters:

NameTypeDescription
world ? ?

Declared on: line 30 of Lua/calls_dispatcher.lua.

function CallsDispatcher.actionInterruptHandler(action, humanoid)

Default checkpoint interrupt handler Reset the assigned status, and find an replacement staff

Parameters:

NameTypeDescription
action ? ?
humanoid ? ?

Declared on: line 410 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher:addChangeCallback(callback, self_value)

Parameters:

NameTypeDescription
callback ? ?
self_value ? ?

Declared on: line 43 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:

NameTypeDescription
staff ? ?

Declared on: line 319 of Lua/calls_dispatcher.lua.

function CallsDispatcher:callForRepair(object, urgent, manual)

Call for repair

Parameters:

NameTypeDescription
object ? ?
urgent ? Announcement should be made
manual ? This call should not trigger advisor for "your machine is failing"

Declared on: line 94 of Lua/calls_dispatcher.lua.

function CallsDispatcher:callForStaff(room)

Parameters:

NameTypeDescription
room ? ?

Declared on: line 57 of Lua/calls_dispatcher.lua.

function CallsDispatcher:callForStaffEachRoom(room, attribute, key)

Parameters:

NameTypeDescription
room ? ?
attribute ? ?
key ? ?

Declared on: line 73 of Lua/calls_dispatcher.lua.

function CallsDispatcher:callForWatering(plant)

Parameters:

NameTypeDescription
plant ? ?

Declared on: line 126 of Lua/calls_dispatcher.lua.

function CallsDispatcher:callNurseForVaccination(patient)

Queues a call for vaccination of a patient @param patient (Patient) the patient who wishes to be vaccinated @return call (table) the call which was queued

Parameters:

NameTypeDescription
patient ? ?

Declared on: line 148 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:

NameTypeDescription
object ? ?
key ? ?

Declared on: line 440 of Lua/calls_dispatcher.lua.

function CallsDispatcher:dump()

Dump the current call table for debugging

Declared on: line 365 of Lua/calls_dispatcher.lua.

function CallsDispatcher.dumpCall(call, message)

Parameters:

NameTypeDescription
call ? ?
message ? ?

Declared on: line 376 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:

NameTypeDescription
object ? ?
key ? ?
description ? ?
verification ? ?
priority ? ?
execute ? ?

Declared on: line 255 of Lua/calls_dispatcher.lua.

function CallsDispatcher:executeCall(call, staff)

Parameters:

NameTypeDescription
call ? ?
staff ? ?

Declared on: line 430 of Lua/calls_dispatcher.lua.

function CallsDispatcher:findSuitableStaff(call)

Find suitable (best) staff for working on a specific call True

Parameters:

NameTypeDescription
call ? ?

Declared on: line 281 of Lua/calls_dispatcher.lua.

function CallsDispatcher.getPriorityForRoom(room, attribute, staff)

Parameters:

NameTypeDescription
room ? ?
attribute ? ?
staff ? ?

Declared on: line 497 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.getPriorityForVaccination(patient, nurse)

Determine which nurse has the highest priority to vaccinate a patient the patient should be easily reachable from the nurse @param patient (Patient) the patient calling for vaccination @param nurse (Staff, humanoid_class Nurse) the nurse to verify if they have priority to vaccinate @return score (Integer) lowest score has higher priority to vaccinate

Parameters:

NameTypeDescription
patient ? ?
nurse ? ?

Declared on: line 207 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.onCheckpointCompleted(call)

Called when a call is completed successfully.

Parameters:

NameTypeDescription
call ? ?

Declared on: line 420 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 appropriate 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:

NameTypeDescription
humanoid ? ?
interrupt_handler ? ?

Declared on: line 400 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher:removeChangeCallback(callback)

Parameters:

NameTypeDescription
callback ? ?

Declared on: line 47 of Lua/calls_dispatcher.lua.

function CallsDispatcher.sendNurseToVaccinate(patient, nurse)

Once a nurse has been verified and priority decided do the actions to perform the actually vaccination, delegated to Epidemic class (@see Epidemic:createVaccinationActions) @param patient (Patient) the patient calling for vaccination @param nurse (Staff, humanoid_class Nurse) the nurse to perform the vaccination actions

Parameters:

NameTypeDescription
patient ? ?
nurse ? ?

Declared on: line 233 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.sendStaffToRepair(object, handyman)

'execute' callback for repairing an object (eg a machine).

Parameters:

NameTypeDescription
object ? Object to repair.
handyman ? Staff to use.

Declared on: line 555 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.sendStaffToRoom(room, staff)

Parameters:

NameTypeDescription
room ? ?
staff ? ?

Declared on: line 533 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.sendStaffToWatering(plant, handyman)

'execute' callback for watering a plant.

Parameters:

NameTypeDescription
plant ? Plant to give water.
handyman ? Staff to use.

Declared on: line 562 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.staffActionInterruptHandler(action, humanoid)

Parameters:

NameTypeDescription
action ? ?
humanoid ? ?

Declared on: line 545 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.unassignCall(call, answer_next_call)

Unassign call

Parameters:

NameTypeDescription
call ? call to unassign from assigned humanoid.
answer_next_call bool should the humanoid assigned to this call then answer for another new call

Declared on: line 468 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.verifyStaffForRoom(room, attribute, staff)

Parameters:

NameTypeDescription
room ? ?
attribute ? ?
staff ? ?

Declared on: line 482 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.

function CallsDispatcher.verifyStaffForVaccination(patient, staff)

Determines if a member of staff is suitable to vaccinate a patient they must be a nurse and not busy or too far away. @param patient (Patient) the patient calling for vaccination @param staff (Staff) staff member to verify if suitable to vaccinate @return true if suitable for vaccination false otherwise (boolean)

Parameters:

NameTypeDescription
patient ? ?
staff ? ?

Declared on: line 179 of Lua/calls_dispatcher.lua.
Note: Is a function rather than a method.