Queue Class
Manages a list of `Humanoid`s which are waiting to use an `Object`.
Full description:
A queue stores a list of humanoids waiting to use an object. For a reception desk, this is as expected. For a room, the queue is for the door, not the room. Hence the queue stores the list of patients waiting to enter (the traditional queue for the room), the list of staff waiting to enter (because of the door being in use for example), the list of staff and patients waiting to leave (again due to door being in use). Queues are currently implemented as normal Lua arrays, but you should access a queue via its methods rather than directly.
Method Index
- back()
- decreaseMaxSize(amount)
- expect(humanoid)
- expectedSize()
- front()
- hasEmergencyPatient()
- increaseMaxSize(amount)
- isFull()
- move(index, new_index)
- patientSize()
- pop()
- push(humanoid, callbacks_on)
- remove(index)
- removeValue(value)
- reportedHumanoid(index)
- reportedSize()
- rerouteAllPatients(action)
- setBenchThreshold(standing_count)
- setMaxQueue(queue_count)
- setPriorityForSameRoom(entity)
- size()
- unexpect(humanoid)
Member Index
- bench_threshold
- callbacks
- expected
- expected_count
- max_size
- reported_size
- same_room_priority
- visitor_count
function Queue:Queue()
Declared on: line 33 of Lua/queue.lua.
function Queue:back()
Declared on: line 175 of Lua/queue.lua.
function Queue:decreaseMaxSize(amount)
Parameters:
Name | Type | Description |
---|---|---|
amount | ? | ? |
Declared on: line 57 of Lua/queue.lua.
function Queue:expect(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 43 of Lua/queue.lua.
function Queue:expectedSize()
Declared on: line 90 of Lua/queue.lua.
function Queue:front()
Declared on: line 171 of Lua/queue.lua.
function Queue:hasEmergencyPatient()
Declared on: line 94 of Lua/queue.lua.
function Queue:increaseMaxSize(amount)
Parameters:
Name | Type | Description |
---|---|---|
amount | ? | ? |
Declared on: line 61 of Lua/queue.lua.
function Queue:isFull()
Declared on: line 82 of Lua/queue.lua.
function Queue:move(index, new_index)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | ? |
new_index | ? | ? |
Declared on: line 230 of Lua/queue.lua.
function Queue:patientSize()
Returns how many patients are queued or expected
Declared on: line 104 of Lua/queue.lua.
function Queue:pop()
Declared on: line 179 of Lua/queue.lua.
function Queue:push(humanoid, callbacks_on)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
callbacks_on | ? | ? |
Declared on: line 118 of Lua/queue.lua.
function Queue:remove(index)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | ? |
Declared on: line 200 of Lua/queue.lua.
function Queue:removeValue(value)
Parameters:
Name | Type | Description |
---|---|---|
value | ? | ? |
Declared on: line 220 of Lua/queue.lua.
function Queue:reportedHumanoid(index)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | ? |
Declared on: line 110 of Lua/queue.lua.
function Queue:reportedSize()
Declared on: line 86 of Lua/queue.lua.
function Queue:rerouteAllPatients(action)
Called when reception desk is destroyed. May be extended later to handle removed rooms, too.
Update: Now also used when a room is destroyed from a crashed machine.
Parameters:
Name | Type | Description |
---|---|---|
action | ? | ? |
Declared on: line 250 of Lua/queue.lua.
function Queue:setBenchThreshold(standing_count)
Parameters:
Name | Type | Description |
---|---|---|
standing_count | ? | ? |
Declared on: line 65 of Lua/queue.lua.
function Queue:setMaxQueue(queue_count)
Parameters:
Name | Type | Description |
---|---|---|
queue_count | ? | ? |
Declared on: line 69 of Lua/queue.lua.
function Queue:setPriorityForSameRoom(entity)
Parameters:
Name | Type | Description |
---|---|---|
entity | ? | ? |
Declared on: line 114 of Lua/queue.lua.
function Queue:size()
Declared on: line 73 of Lua/queue.lua.
function Queue:unexpect(humanoid)
Parameters:
Name | Type | Description |
---|---|---|
humanoid | ? | ? |
Declared on: line 50 of Lua/queue.lua.