Room Class
Subclasses: BloodMachineRoom, CardiogramRoom, DNAFixerRoom, DecontaminationRoom, ElectrolysisRoom, FractureRoom, GPRoom, GeneralDiagRoom, HairRestorationRoom, InflationRoom, JellyVatRoom, OperatingTheatreRoom, PharmacyRoom, PsychRoom, ResearchRoom, ScannerRoom, SlackTongueRoom, StaffRoom, ToiletRoom, TrainingRoom, UltrascanRoom, WardRoom, XRayRoom
Method Index
- afterLoad(old, new)
- canHumanoidEnter(humanoid)
- commandEnteringPatient(humanoid)
- commandEnteringStaff(humanoid, already_initialized)
- crashRoom()
- createDealtWithPatientCallback(humanoid)
- createEnterAction(humanoid_entering, callback)
- createLeaveAction()
- deactivate()
- dealtWithPatient(patient)
- findWorkForStaff()
- getEntranceXY(inside)
- getMaximumStaffCriteria()
- getMissingStaff(criteria)
- getPatient()
- getPatientCount()
- getRequiredStaffCriteria()
- getStaffMember()
- getUsageScore()
- hasQueueDialog()
- initRoom(x, y, w, h, door, door2)
- isWaitingToGetStaff(staff)
- makeHumanoidLeave(patient)
- onHumanoidEnter(humanoid)
- onHumanoidLeave(humanoid)
- roomFinished()
- setStaffMember(staff)
- setStaffMembersAttribute(attribute, value)
- shouldHavePatientReenter(patient)
- staffFitsInRoom(staff)
- staffMeetsRoomRequirements(humanoid)
- testStaffCriteria(criteria, extra_humanoid)
- tryAdvanceQueue()
- tryToEdit()
- tryToFindNearbyPatients()
Member Index
- active
- built
- crashed
- dealt_patient_callback
- door
- door2
- height
- hospital
- humanoids
- humanoids_enroute
- id
- is_active
- maximum_patients
- needs_repair
- objects
- room_info
- sound_played
- staff_member
- waiting_staff_member
- width
- world
- x
- y
function Room:Room(x, y, w, h, id, room_info, world, hospital, door, door2)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
w | ? | ? |
h | ? | ? |
id | ? | ? |
room_info | ? | ? |
world | ? | ? |
hospital | ? | ? |
door | ? | ? |
door2 | ? | ? |
Declared on: line 25 of Lua/room.lua.
function Room:afterLoad(old, new)
Stub to be extended in subclasses, if needed.
Parameters:
Name | Type | Description |
---|---|---|
old | ? | ? |
new | ? | ? |
Declared on: line 835 of Lua/room.lua.
function Room:canHumanoidEnter(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 596 of Lua/room.lua.
function Room:commandEnteringPatient(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 454 of Lua/room.lua.
function Room:commandEnteringStaff(humanoid, already_initialized)
When a valid member of staff enters the room this function is called.
Can be extended in derived classes.
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | The staff in question |
already_initialized | ? | If true, this means that the staff has already got order what to do. |
Declared on: line 435 of Lua/room.lua.
function Room:crashRoom()
Declared on: line 695 of Lua/room.lua.
function Room:createDealtWithPatientCallback(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 374 of Lua/room.lua.
function Room:createEnterAction(humanoid_entering, callback)
Parameters:
Name | Type | Description |
---|---|---|
humanoid_entering | ? | ? |
callback | ? | ? |
Declared on: line 90 of Lua/room.lua.
function Room:createLeaveAction()
Declared on: line 79 of Lua/room.lua.
function Room:deactivate()
Declared on: line 793 of Lua/room.lua.
function Room:dealtWithPatient(patient)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 142 of Lua/room.lua.
function Room:findWorkForStaff()
Checks if the room still needs the staff in it and otherwise
sends them away if they're needed somewhere else.
Declared on: line 189 of Lua/room.lua.
function Room:getEntranceXY(inside)
Parameters:
Name | Type | Description |
---|---|---|
inside | ? | ? |
Declared on: line 66 of Lua/room.lua.
function Room:getMissingStaff(criteria)
Given any type of staff criteria (required/maximum), subtract the staff in the room and return the result
Parameters:
Name | Type | Description |
---|---|---|
criteria | ? | ? |
Declared on: line 207 of Lua/room.lua.
function Room:getPatient()
Declared on: line 116 of Lua/room.lua.
function Room:getPatientCount()
Declared on: line 124 of Lua/room.lua.
function Room:getStaffMember()
Returns the current staff member. Can be overriden in rooms with multiples staff members to return the desired one.
Declared on: line 396 of Lua/room.lua.
function Room:getUsageScore()
how many tiles further are we willing to walk if the room has all the required staff
Declared on: line 581 of Lua/room.lua.
function Room:hasQueueDialog()
Declared on: line 831 of Lua/room.lua.
function Room:initRoom(x, y, w, h, door, door2)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
w | ? | ? |
h | ? | ? |
door | ? | ? |
door2 | ? | ? |
Declared on: line 34 of Lua/room.lua.
function Room:isWaitingToGetStaff(staff)
Tests whether this room is awaiting more staff to be able to do business
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 426 of Lua/room.lua.
function Room:makeHumanoidLeave(patient)
Tells a humanoid in the room to leave it. This can be overridden for special
handling, e.g. if the humanoid needs to change before leaving the room.
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 785 of Lua/room.lua.
function Room:onHumanoidEnter(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 268 of Lua/room.lua.
function Room:onHumanoidLeave(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 496 of Lua/room.lua.
function Room:roomFinished()
Function stub for rooms to implement. Called when the final confirm
button has been pressed when building/editing a room.
Declared on: line 614 of Lua/room.lua.
function Room:setStaffMember(staff)
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 401 of Lua/room.lua.
function Room:setStaffMembersAttribute(attribute, value)
function that sets a given attribute to a given value for all staff members.
Should be overriden for rooms that have more than one staff member.
Parameters:
Name | Type | Description |
---|---|---|
attribute | ? | ? |
value | ? | ? |
Declared on: line 134 of Lua/room.lua.
function Room:shouldHavePatientReenter(patient)
Parameters:
Name | Type | Description |
---|---|---|
patient | ? | ? |
Declared on: line 576 of Lua/room.lua.
function Room:staffFitsInRoom(staff)
Returns false if the room is already full of staff or if the given member of staff cannot help out.
Otherwise returns true.
Parameters:
Name | Type | Description |
---|---|---|
staff | ? | ? |
Declared on: line 405 of Lua/room.lua.
function Room:staffMeetsRoomRequirements(humanoid)
Returns true if the humanoid meets (one of) the required staff criteria of the room
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 415 of Lua/room.lua.
function Room:testStaffCriteria(criteria, extra_humanoid)
Parameters:
Name | Type | Description |
---|---|---|
criteria | ? | ? |
extra_humanoid | ? | ? |
Declared on: line 224 of Lua/room.lua.
function Room:tryAdvanceQueue()
Declared on: line 469 of Lua/room.lua.
function Room:tryToEdit()
Declared on: line 803 of Lua/room.lua.