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 Refactoring and Add EntityFactory #38
Conversation
|
||
import Foundation | ||
|
||
struct EntityFactory { |
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.
This probably needs some discussion, but I was thinking if we should use a Builder Pattern here to create the entities?
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.
Builder pattern sounds good. Incorporated it.
But i think we should still have the factory pattern. The whole idea is that we don't want users to forget to add components into the game. Builder pattern still requires player to manually add the components.
Now when you call the factory, it will instantiate an EntityBuilder to create the components of the entity.
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.
LGTM :)
Resolves #32
Changes made