-
Notifications
You must be signed in to change notification settings - Fork 5
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
lens/ProjectionScreen.js dependency common model code #173
Comments
You are right that the dependencies of LightRays on ProjectorScreen is very hard corded as you point out. The position of the projector is used as a proxy to denote that the shape of the bisecting line has moved. The projectorScreen role is solely to block rays and to send a signal that the rays have reached their destination. In the long run, it would be better to instantiate the projector screen in the lens model. At that point, it could inform the the lightRays that there exists a blocking shape through a method on lightRays. |
ProjectorScreen.js is now ProjectionScreen.js. |
I disagree. ProjectorScreen (now ProjectionScreen) is relevant only to the Lens screen. The preferrable solution is to generalize LightRays so that it's not dependent on ProjectionScreen. (I think this is what @veillette was saying above in #173 (comment).) So that's the direction that I'm going to take. |
The dependency on ProjectorScreen has been removed from js/common/. The common model can now be provided with an optional "barrier", which is any object that implements Closing. |
While working on #154 I found myself pretty surprised as to how much ProjectorScreen is used inside of common model code. I initially read the implementation notes, including the gotcha, but I didn't realize how pervasive the link is. To me this is a spectrum of potential improvements that I would like to brainstorm. From easiest hardest.
lens/
screen folder be used by common. This is more confusing that it is benefitial, even though those types are only part of the lens screen topic. At the very least, ProjectorScreen and its dependencies would move tocommon/model/
. I hope this isn't the end of the conversation though.lens/
code. It looked like some amount of work, but not exhaustive.Let me know what you think!
The text was updated successfully, but these errors were encountered: