Members
group :Group
This player's group.
Type:
id :String
The player's ID.
Type:
- String
idInGroup :Number
Type:
- Number
participant :Participant
This player's participant.
Type:
points :number
Type:
- number
stage :Stage
Type:
stageIndex :number
Type:
- number
status :string
The current status of this player.
- 'ready': the player is ready to play their current stage, but is waiting (for their fellow group members).
- 'playing': the player is playing their current stage.
- 'done': the player is done playing their current stage, waiting to call 'Stage.playerEnd(player)'.
- 'finished': player is ready to move to next stage.
See Session Flow tutorial for more details.
Type:
- string
Methods
addClient(client)
addClient - description
Parameters:
| Name | Type | Description |
|---|---|---|
client |
type | description |
app()
app - description
Returns:
App The app that this player is a member of.
appIndex() → {type}
appIndex - description
Returns:
description
- Type
- type
atLeastFinishedStage()
Is the player at least finished the given stage of the given period?
Return false if any of the following are true:
- the player is in a previous app.
- the player is in the same app, but a previous period.
- the player is in the same period, but a previous stage.
- the player is in the same stage, but is still 'playing'.
Otherwise return true.
CALLED FROM:
- Stage#playerCanGroupProceedToNextStage.
compId() → {type}
compId - description
Returns:
description
- Type
- type
emit(name, dta)
emit - description
Parameters:
| Name | Type | Description |
|---|---|---|
name |
type | description |
dta |
type | description |
emitUpdate() → {type}
emitUpdate - description
Returns:
description
- Type
- type
endStage(endGroupopt, moveopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
endGroup |
boolean |
<optional> |
true | Then try to end the stage for the group too. |
move |
boolean |
<optional> |
true | Then move on to the next stage. The group ending a stage |
endStageIfStill()
Ends stage for this player if they are still playing it (see timeUp).
inAllPeriods()
This participant's players in this app's periods, from the first to this one.
inPeriod()
This participant's player in period n (from 1) of this app, or null if there is none yet.
inPreviousPeriods()
This participant's players in this app's periods before this one, first first.
isFinished() → {type}
isFinished - description
Returns:
description
- Type
- type
isFinishedStage()
Whether this player has finished stage, of their current period: played it (done or
finished), or gone past it. (Players skip stages on their own, so the group's current
stage, which isFinished goes by, may be past theirs.)
isReady() → {type}
isReady - description
Returns:
description
- Type
- type
matchesPlayer(plyrShell) → {boolean}
matchesPlayer - description
Parameters:
| Name | Type | Description |
|---|---|---|
plyrShell |
type | description |
Returns:
whether or not the inputted player matches this one.
- Type
- boolean
nextStage()
The next stage for this player.
old() → {type}
old - description
Returns:
description
- Type
- type
otherPlayersInGroup() → {type}
otherPlayersInGroup - description
Returns:
description
- Type
- type
period() → {type}
period - description
Returns:
description
- Type
- type
periodIndex() → {type}
periodIndex - description
Returns:
description
- Type
- type
roomId() → {type}
roomId - description
Returns:
description
- Type
- type
save()
save - description
sendUpdate(channel)
sendUpdate - description
Parameters:
| Name | Type | Description |
|---|---|---|
channel |
type | description |
session() → {type}
session - description
Returns:
description
- Type
- type
shell() → {type}
this - description
Returns:
description
- Type
- type
shellWithChildren() → {type}
CALLED FROM
- Participant#shellAll
Returns:
description
- Type
- type
startTimer()
Starts this player's own timer for stage, if it has one (see Stage#clientDuration).
timeUp()
This player's time for stage is up: marks them timed out, and unless the stage stays
open (Stage#endOnTimeout), asks their page to submit what it has and, if it has not
within stage.timeoutGrace seconds (or the player has no page), ends the stage for them.
(static) load(json, session) → {type}
Parameters:
| Name | Type | Description |
|---|---|---|
json |
type | description |
session |
type | description |
Returns:
description
- Type
- type