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

Version out of sync with DOC.md #32

Open
Calamari opened this issue Nov 9, 2021 · 5 comments
Open

Version out of sync with DOC.md #32

Calamari opened this issue Nov 9, 2021 · 5 comments

Comments

@Calamari
Copy link

Calamari commented Nov 9, 2021

The DOC.md is mentioning some nice and useful features, that the version I got from NPM (0.0.2) does not seem to have, like

 Property 'onEntityAdded' does not exist on type 'Query<Entity>'.ts(2339)

seems not to be defined. Also there are some other changes to the NPM version, like different names of decorators.

When is it coming out?

I just switched from ecsy to ecstra. And I like it so far :-)
Need some help? I plan to build my next game with ecstra, if that works out. :-)

@DavidPeicho
Copy link
Owner

Hi! Thanks for the interest in the library. I haven't had much time those last few months to work on it because I am also teaching in addition to my day job.
Those features are ready and tested but simply not published yet. I will try to find sometimes to publish a new version :)

Any help to drive this library further is appreciated!

@Calamari
Copy link
Author

Calamari commented Nov 10, 2021

Sure. If I can help, I will :-)

But a thought on the onEntityAdded. Why is that a property on the Query? Seems dangerous, since different systems could set it, and they would override it?
And from an API point of view: Why not make it work the same as .execute(entity =>{})? That would make it read nicer.
Shall I try doing that?

@DavidPeicho
Copy link
Owner

Yeah it's indeed an issue. It should at least be an array of callbacks or something.
It's not a callback n the system because you might need to know what query triggered the callback right?

@Calamari
Copy link
Author

Not quite sure what you mean with the last part.

What I like about ecsy, for example is the way you define query additions and removals. It looks like this:

this.queries.dudesOnTheMap.added(entity => …)

the same way, that execute looks. Internally, the query managers are (or have) event dispatcher, that triggers events for query-relevant items. It also makes for a nicer and more congruent API.

@DavidPeicho
Copy link
Owner

Yes I see what you mean. I actually double checked my code, I wrote it a long back:

archetype.onEntityAdded.observe(addedObs);

So basically it's pretty close to what Ecsy does. What I need is to have an array of listeners instead of overriding the callback, and then we can just rename onEntityAdded to added or anything meaningfull.

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