-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor changes to REMOVE_SCENE/ core #427
base: develop
Are you sure you want to change the base?
Minor changes to REMOVE_SCENE/ core #427
Conversation
Should fix #330. The corresponding functionality wasn't implemented. Probably needs some tests just to be sure. |
9b9035c
to
dc5df3b
Compare
@@ -402,12 +405,13 @@ FamousEngine.prototype.addScene = function addScene (scene) { | |||
* @return {FamousEngine} this | |||
*/ | |||
FamousEngine.prototype.removeScene = function removeScene (scene) { | |||
var selector = scene._selector; | |||
var selector = scene._id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between _id and _selector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scene now inherits from Node. This significantly simplifies the Scene constructor. The id of a scene is its selector, therefore it should be able to be retrieved through getLocation
etc.
The `FamousEngine` is supposed to expose an API for adding and removing scenes. While the corresponding methods have been outlined, the Scene class itself doesn't reflect the ability to re-mount the scene to a different selector. * The Scene constructor accepts an updater and a selector * Scene#_globalUpdater is inconsistent with the inherited, Node-specific (theoretically) Node#_updater * The Scene updater is being set as via the constructor (instead of Node#_setUpdater) * The Scene constructor requests the context size * The scene constructor no longer accepts any arguments * The scene itself is not bound to a specific selector, but instead can be mounted to an arbitrary path (just like nodes) * Scene constructor logic has been moved to Scene#mount * Less redundancy * More flexibility: Scene can request size at a later point in time instead of upon instantiation * Scene constructor does not have side effects * Scene updater (Scene#_globalUpdater) can be changed via Dispatch * => FamousEngine#removeScene and FamousEngine#addScene can be implemented
dc5df3b
to
d35c27b
Compare
Addresses multiple issues with the current Scene implementation (especially see 20a6744).