Skip to content
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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

alexanderGugel
Copy link
Member

Addresses multiple issues with the current Scene implementation (especially see 20a6744).

@alexanderGugel
Copy link
Member Author

Should fix #330. The corresponding functionality wasn't implemented. Probably needs some tests just to be sure.

@alexanderGugel alexanderGugel force-pushed the REMOVE_SCENE-command branch 2 times, most recently from 9b9035c to dc5df3b Compare July 21, 2015 11:48
@@ -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;
Copy link
Contributor

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?

Copy link
Member Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants