Constructor
new Group(id, period)
Create a new Group.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | The id of this group. |
period |
Period | The period this group belongs to. |
Members
allPlayersCreated :boolean
whether or not all players in this group have been created yet.
Type:
- boolean
id :String
this group's id
Type:
- String
outputHide :array
'outputHide' fields are not included in output.
Type:
- array
outputHideAuto :Array.<String>
'outputHideAuto' fields are not included in output.
Type:
- Array.<String>
period :Period
Each Group belongs to a single Period.
Type:
players :array
a list of the players in this group.
Type:
- array
stageIndex :number
Type:
- number
tables :array
Type:
- array
Methods
app() → {App}
Returns the app this group is in.
Returns:
The app.
- Type
- App
emit(msgTitle, msgData)
Emit the given message to subscriber's of this group.
Parameters:
| Name | Type | Description |
|---|---|---|
msgTitle |
type | The title of the message. |
msgData |
type | The data of the message. |
emitUpdate() → {type}
emitUpdate - description
Returns:
description
- Type
- type
endStageForSilentPlayers()
Ends stage for players still in it, after it timed out and their page did not submit.
forceEndStage()
The stage timed out: ends it for players who have not ended it, marking them
Player#timedOut.
inAllPeriods()
The groups with this group's id in this app's periods, from the first to this one.
inPeriod()
The group with this group's id in period n (from 1) of this app, or null if there is none yet.
inPreviousPeriods()
The groups with this group's id in this app's periods before this one, first first.
isFinished() → {type}
isFinished - description
Returns:
description
- Type
- type
old() → {type}
old - description
Returns:
description
- Type
- type
playerByParticipantId(id) → {type}
Find the player with the given participant ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | the given id. |
Returns:
the player where player.participant.id == id.
- Type
- type
playerWithParticipant(participant) → {type}
playerWithParticipant - description
Parameters:
| Name | Type | Description |
|---|---|---|
participant |
type | description |
Returns:
description
- Type
- type
playersExcept(player) → {type}
playersExcept - description
Parameters:
| Name | Type | Description |
|---|---|---|
player |
type | description |
Returns:
description
- Type
- type
restoreStageTimer()
For a group loaded from a session's file (see Group.load), starts the stage timer it
had. The stage's time ran until jtree stopped (lastTimeOn) and stood still while it was
off; time already up ends the stage straight away.
roomId() → {type}
roomId - description
Returns:
description
- Type
- type
save()
save - description
session()
session - description
Returns:
Session The session that this group belongs to.
shell() → {type}
shellLocal - description
Returns:
description
- Type
- type
shellWithChildren() → {type}
shellAll - description
Returns:
description
- Type
- type
shellWithParent() → {type}
shell - description
Returns:
description
- Type
- type
stage()
Returns the stage that this group is currently in.
startStageTimer()
Starts the timer that ends stage for this group (see forceEndStage) in ms milliseconds.
sum(field)
Returns the sum of "field" over all players in the group.
Parameters:
| Name | Type | Description |
|---|---|---|
field |
String |
(static) load(json, session) → {Group}
Loads the group from a given set of data.
CALLED FROM:
- Session#load
Parameters:
| Name | Type | Description |
|---|---|---|
json |
type | The JSON data describing the group. |
session |
type | The session to which the group belongs. |
Returns:
The group.
- Type
- Group