diff --git a/src/state/IState.ts b/src/state/IState.ts index 521c494..c0456ba 100644 --- a/src/state/IState.ts +++ b/src/state/IState.ts @@ -16,7 +16,9 @@ export interface IState extends EventEmitter { reset(): void; + getGroups(): Map; getGroup(id: string): IGroup; + getScenes(): Map; getScene(id: string): IScene; onSceneCreate(data: ISceneData): IScene; synchronizeScenes(data: ISceneDataArray): IScene[]; @@ -24,6 +26,7 @@ export interface IState extends EventEmitter { getControl(id: string): IControl; + getParticipants(): Map; getParticipantByUserID(id: number): IParticipant; getParticipantByUsername(name: string): IParticipant; getParticipantBySessionID(id: string): IParticipant; diff --git a/src/state/State.ts b/src/state/State.ts index 0a568ca..a03aebe 100644 --- a/src/state/State.ts +++ b/src/state/State.ts @@ -308,6 +308,13 @@ export class State extends EventEmitter implements IState { return group; } + /** + * Retrieve all groups. + */ + public getGroups(): Map { + return this.groups; + } + /** * Retrieve a group with the matching ID from the group store. */ @@ -315,6 +322,13 @@ export class State extends EventEmitter implements IState { return this.groups.get(id); } + /** + * Retrieve all scenes + */ + public getScenes(): Map { + return this.scenes; + } + /** * Retrieve a scene with the matching ID from the scene store. */ @@ -336,6 +350,13 @@ export class State extends EventEmitter implements IState { return result; } + /** + * Retrieve all participants. + */ + public getParticipants(): Map { + return this.participants; + } + private getParticipantBy(field: K, value: IParticipant[K]): IParticipant { let result; this.participants.forEach(participant => {