Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ export class Client extends EventEmitter implements IClient {
throw new PermissionDeniedError('createGroups', 'Participant');
}

public createScene(_: ISceneData): Promise<ISceneData> {
throw new PermissionDeniedError('createScene', 'Participant');
}

public createScenes(_: ISceneDataArray): Promise<ISceneDataArray> {
throw new PermissionDeniedError('createScenes', 'Participant');
}
Expand Down
10 changes: 10 additions & 0 deletions src/GameClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ export class GameClient extends Client {
return this.execute('createGroups', groups, false);
}

/**
* Instructs the server to create a new scene with the specified parameters.
*/
public createScene(scene: ISceneData): Promise<ISceneData> {
return this.createScenes({ scenes: [ scene ] })
.then(scenes => {
return scenes.scenes[0];
});
}

/**
* Instructs the server to create new scenes with the specified parameters.
*/
Expand Down
1 change: 1 addition & 0 deletions src/IClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface IClient extends EventEmitter {

createControls(controls: ISceneData): Promise<IControl[]>;
createGroups(groups: IGroupDataArray): Promise<IGroupDataArray>;
createScene(scene: ISceneData): Promise<ISceneData>;
createScenes(scenes: ISceneDataArray): Promise<ISceneDataArray>;
updateControls(controls: ISceneData): Promise<void>;
updateGroups(groups: IGroupDataArray): Promise<IGroupDataArray>;
Expand Down