Module CorsixTH.CorsixTH.Lua.room
Get the tile next to the door.
Functions
| Room:_staffWaitToggle (activate) | Activates and deactivates the staff waiting for patient mood icon and dynamic info text |
| Room:afterLoad (old, new) | Stub to be extended in subclasses, if needed. |
| Room:calculateRemovalCost () | Get the removal cost |
| Room:commandEnteringStaff (humanoid, already_initialized) | When a valid member of staff enters the room this function is called. |
| Room:countWindows () | Count the number of windows in the room |
| Room:crashRoom () | Explode the room. |
| Room:createLeaveAction () | Construct an 'walk' action to the tile next to the door, just outside the room. |
| Room:deactivate () | Deactivate the room from the world. |
| Room:findWorkForStaff () | Checks if the room still needs the staff in it and otherwise sends them away if they're needed somewhere else. |
| Room:getMaximumStaffCriteria () | Get the type and number of maximum staff for the room. |
| Room:getPatient () | Get a patient in the room. |
| Room:getPatientCount () | Count the number of patients in the room. |
| Room:getRequiredStaffCriteria () | Get the type and number of required staff for the room. |
| Room:getStaffMember () | Get the current staff member. |
| Room:getStaffServiceQuality () | Get the average service quality of the staff members in the room. |
| Room:getUsageScore () | Score function to decide how desirable a room is for a patient. |
| Room:setStaffMember (staff) | Set the current staff member. |
| Room:staffFitsInRoom (staff) | Does the given staff member fit in the room? |
| Room:staffMeetsRoomRequirements (humanoid) | Returns true if the humanoid meets (one of) the required staff criteria of the room |
| Room:tryToFindNearbyPatients () | Try to find new patients for this room by 'stealing' them from other rooms nearby. |
Functions
- Room:_staffWaitToggle (activate)
-
Activates and deactivates the staff waiting for patient mood icon
and dynamic info text
Parameters:
- activate (bool) - true to activate, false or nil to deactivate
- Room:afterLoad (old, new)
-
Stub to be extended in subclasses, if needed.
Parameters:
- old
- new
- Room:calculateRemovalCost ()
-
Get the removal cost
Returns:
-
(int) cost of the room
- 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:
- humanoid The staff in question
- already_initialized If true, this means that the staff has already got order what to do.
- Room:countWindows ()
-
Count the number of windows in the room
Returns:
-
(int) Number of windows
- Room:crashRoom ()
- Explode the room.
- Room:createLeaveAction ()
-
Construct an 'walk' action to the tile next to the door, just outside the room.
Returns:
-
Action to move to the tile just outside the room.
- Room:deactivate ()
- Deactivate the room from the world.
- Room:findWorkForStaff ()
- Checks if the room still needs the staff in it and otherwise sends them away if they're needed somewhere else.
- Room:getMaximumStaffCriteria ()
-
Get the type and number of maximum staff for the room.
Returns:
-
(table) Type and number of maximum staff.
- Room:getPatient ()
-
Get a patient in the room.
Returns:
-
A patient (humanoid) if there is a patient, nil otherwise.
- Room:getPatientCount ()
-
Count the number of patients in the room.
Returns:
-
Number of patients in the room.
- Room:getRequiredStaffCriteria ()
-
Get the type and number of required staff for the room.
Returns:
-
(table) Type and number of required staff.
- Room:getStaffMember ()
-
Get the current staff member.
In multi-occupancy rooms this returns the staff member with the minimum service quality
Returns:
-
(staff) The current staff member.
- Room:getStaffServiceQuality ()
-
Get the average service quality of the staff members in the room.
Returns:
-
(float) [0-1] Average staff service quality.
- Room:getUsageScore ()
-
Score function to decide how desirable a room is for a patient.
Returns:
-
(int) The score, lower is better.
- Room:setStaffMember (staff)
-
Set the current staff member.
Parameters:
- staff (staff) Staff member to denote as current staff.
- Room:staffFitsInRoom (staff)
-
Does the given staff member fit in the room?
Returns false if the room is already full of staff or if the given member of staff cannot help out.
Otherwise returns true.
Parameters:
- staff
Returns:
-
(bool) True if the staff member can work in the room, else False.
- Room:staffMeetsRoomRequirements (humanoid)
-
Returns true if the humanoid meets (one of) the required staff criteria of the room
Parameters:
- humanoid
- Room:tryToFindNearbyPatients ()
- Try to find new patients for this room by 'stealing' them from other rooms nearby.