Skip to content

Commit

Permalink
Add sceneUid, sceneUids, groupUid, groupUids getter / setter on Story.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rroux-gpsw committed Mar 7, 2017
1 parent 504d3ed commit 1047b26
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions src/story/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ FORGE.Story.prototype.destroy = function()
Object.defineProperty(FORGE.Story.prototype, "config",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
return this._config;
}
Expand Down Expand Up @@ -724,7 +724,7 @@ Object.defineProperty(FORGE.Story.prototype, "description",
Object.defineProperty(FORGE.Story.prototype, "scenes",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
return FORGE.UID.get(this._scenes);
}
Expand All @@ -738,7 +738,7 @@ Object.defineProperty(FORGE.Story.prototype, "scenes",
Object.defineProperty(FORGE.Story.prototype, "scene",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
if(this._sceneUid === null || this._sceneUid === "")
{
Expand All @@ -755,18 +755,38 @@ Object.defineProperty(FORGE.Story.prototype, "scene",
}
});

/**
* Get all the sceneUids.
* @name FORGE.Story#sceneUids
* @readonly
* @type {Array<string>}
*/
Object.defineProperty(FORGE.Story.prototype, "sceneUids",
{
/** @this {FORGE.Story} */
get: function()
{
return this._scenes;
}
});

/**
* Get the current sceneUid.
* @name FORGE.Story#sceneUid
* @readonly
* @type {string}
*/
Object.defineProperty(FORGE.Story.prototype, "sceneUid",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
return this._sceneUid;
},

/** @this {FORGE.Story} */
set: function(value)
{
this.loadScene(value);
}
});

Expand All @@ -793,7 +813,7 @@ Object.defineProperty(FORGE.Story.prototype, "groups",
Object.defineProperty(FORGE.Story.prototype, "group",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
if(this._groupUid === null || this._groupUid === "")
{
Expand All @@ -810,18 +830,38 @@ Object.defineProperty(FORGE.Story.prototype, "group",
}
});

/**
* Get all the group Uids.
* @name FORGE.Story#groupUids
* @readonly
* @type {Array<string>}
*/
Object.defineProperty(FORGE.Story.prototype, "groupUids",
{
/** @this {FORGE.Story} */
get: function()
{
return this._groups;
}
});

/**
* Get the current groupUid.
* @name FORGE.Story#groupUid
* @readonly
* @type {string}
*/
Object.defineProperty(FORGE.Story.prototype, "groupUid",
{
/** @this {FORGE.Story} */
get: function ()
get: function()
{
return this._groupUid;
},

/** @this {FORGE.Story} */
set: function(value)
{
this.loadGroup(value);
}
});

Expand Down

0 comments on commit 1047b26

Please # to comment.