five-on-it / apps/client/src/ui/lobby / canSwitchTo
Function: canSwitchTo()
canSwitchTo(
view,team):boolean
Defined in: apps/client/src/ui/lobby.ts:145
Whether the reader may move to a team: a member, gathering, another team with room for their party.
Parameters
view
canStart
boolean = ...
Whether the host may start it now: every team has its minimum.
countdown
{ seconds: number; waiting: boolean; } | null = ...
The countdown: the seconds left, and whether it waits for a game server (the city busy).
game
{ by: string; curated: boolean; id: string; level: string; rating: { average: number; count: number; }; title: string; } = ...
game.by
string = ...
game.curated
boolean = ...
game.id
string = ...
game.level
string = ...
game.rating
{ average: number; count: number; } = ...
game.rating.average
number = ...
game.rating.count
number = ...
game.title
string = ...
host
string | null = ...
The host's account id; null to a reader who is not a member.
id
string = ...
join?
{ joinUrl: string; room: string; run: string; } = ...
The reader's way into the lobby's run under way, when Quick play has just seated them in it (Quick play's answer alone): the run, its room and the reader's join URL.
join.joinUrl
string = ...
join.room
string = ...
join.run
string = ...
max
number = ...
mission
{ blurb: string | null; id: string; rules: { each: boolean; friendlyFire: boolean; joinInProgress: "never" | "untilCheckpoint" | "always"; lives: { count: number; per: "player" | "team"; } | null; mode: "solo" | "coop" | "versus"; onDeath: "checkpoint" | "spectate" | "teamSpawn"; players: { max: number; min: number; }; respect: number | null; retries: number; teams: object[]; timeLimit: number | null; }; title: string; } = ...
mission.blurb
string | null = ...
mission.id
string = Id
mission.rules
{ each: boolean; friendlyFire: boolean; joinInProgress: "never" | "untilCheckpoint" | "always"; lives: { count: number; per: "player" | "team"; } | null; mode: "solo" | "coop" | "versus"; onDeath: "checkpoint" | "spectate" | "teamSpawn"; players: { max: number; min: number; }; respect: number | null; retries: number; teams: object[]; timeLimit: number | null; } = LobbyRules
mission.rules.each
boolean = ...
mission.rules.friendlyFire
boolean = ...
mission.rules.joinInProgress
"never" | "untilCheckpoint" | "always" = ...
mission.rules.lives
{ count: number; per: "player" | "team"; } | null = ...
So many lives per player or for the team; null: unlimited.
mission.rules.mode
"solo" | "coop" | "versus" = ...
mission.rules.onDeath
"checkpoint" | "spectate" | "teamSpawn" = ...
mission.rules.players
{ max: number; min: number; } = Range
mission.rules.players.max
number = ...
mission.rules.players.min
number = ...
mission.rules.respect
number | null = ...
The Respect tier it asks for now (a creator's mission held to tier 2 until it qualifies); null for none.
mission.rules.retries
number = ...
mission.rules.teams
object[] = ...
Its teams (co-op's one); a free-for-all's none: every player on their own (each).
mission.rules.timeLimit
number | null = ...
The longest an attempt may take (s); null when nothing bounds it.
mission.title
string = ...
notice
{ code: "busy" | "gaveUp" | "refused" | "inRun"; text: string; } | null = ...
players
number = ...
playlist?
"any" | "coop" | "versus" | "races" | null = ...
The playlist it was opened from (its vote's offers come from it); null (or absent) for none.
results
{ forfeit: boolean; mission: string; outcome: "complete" | "failed" | "abandoned" | "won" | "draw" | "lost"; run: string | null; seats: object[]; seconds: number | null; title: string; winner: string | null; winnerName: string | null; } | null = ...
run
string | null = ...
The run under way, its id (to its members alone).
state
"gathering" | "countdown" | "running" | "ready" | "results" = ...
teams
object[] = ...
visibility
"private" | "public" = ...
vote
{ endsIn: number; mine: "level" | "game" | "same" | "replay" | null; offers: object[]; } | null = ...
you
string | null = ...
The reader's account id when they are a member, else null.
team
string
Returns
boolean