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

Component instance creation cannot compile #19

Closed
dustinfreeman opened this issue Nov 30, 2013 · 2 comments
Closed

Component instance creation cannot compile #19

dustinfreeman opened this issue Nov 30, 2013 · 2 comments

Comments

@dustinfreeman
Copy link
Contributor

https://gist.github.com/dustinfreeman/7725413/revisions

Using the syntax given under the heading "Assigning components to entities" in the Readme. It does appear to work using the return value from assign.

Either the Readme is wrong, or I'm doing something wrong.

@alecthomas
Copy link
Owner

Apologies, that is a legacy from converting between smart pointer types. You'll need to do:

entityx::ptr<TestComponent> testComponent2(new TestComponent("test component from new"));

or the following should work too

entity.assign<TestComponent>("test component from new");

I'll update the README.

@dustinfreeman
Copy link
Contributor Author

I'm glad my futzing around is improving EntityX's docs.

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

No branches or pull requests

2 participants