diff --git a/src/Client.ts b/src/Client.ts index 7b2e35b..35b449d 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -262,6 +262,10 @@ export class Client extends EventEmitter implements IClient { throw new PermissionDeniedError('createGroups', 'Participant'); } + public createScene(_: ISceneData): Promise { + throw new PermissionDeniedError('createScene', 'Participant'); + } + public createScenes(_: ISceneDataArray): Promise { throw new PermissionDeniedError('createScenes', 'Participant'); } diff --git a/src/GameClient.ts b/src/GameClient.ts index 7f99da7..5d4ed4c 100644 --- a/src/GameClient.ts +++ b/src/GameClient.ts @@ -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 { + return this.createScenes({ scenes: [ scene ] }) + .then(scenes => { + return scenes.scenes[0]; + }); + } + /** * Instructs the server to create new scenes with the specified parameters. */ diff --git a/src/IClient.ts b/src/IClient.ts index 87eb318..496003c 100644 --- a/src/IClient.ts +++ b/src/IClient.ts @@ -22,6 +22,7 @@ export interface IClient extends EventEmitter { createControls(controls: ISceneData): Promise; createGroups(groups: IGroupDataArray): Promise; + createScene(scene: ISceneData): Promise; createScenes(scenes: ISceneDataArray): Promise; updateControls(controls: ISceneData): Promise; updateGroups(groups: IGroupDataArray): Promise;