Skip to content

Commit

Permalink
add comments on roster methods
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Dec 29, 2024
1 parent 8ce65f6 commit 796c193
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,12 @@ export class Room {
}

getConnectedPlayers = () => {
// Returns players that are currently connected and not spectators
return this.roster.filter((p) => p.connected);
};

getActivePlayers = () => {
// Returns all players not marked as spectator (includes disconnected)
// Currently just returns all players
// In the future we might want to ignore spectators
return this.roster;
Expand Down

0 comments on commit 796c193

Please sign in to comment.