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

Allow defining messages inside the component definition body #7

Open
mjstahlberg opened this issue Sep 9, 2014 · 4 comments
Open

Comments

@mjstahlberg
Copy link
Member

Allow defining messages inside the component definition body of the yaml document, so messages that are only relevant to a single component can be grouped more easily. This doesn't need to (but can, if it improves performance) have any semantic meaning, this issue just concerns the yaml layout.

@Kangz
Copy link
Contributor

Kangz commented Sep 9, 2014

Shouldn't be too difficult to add, there might be name clashes though.

@mjstahlberg
Copy link
Member Author

In that case an error could be thrown, I don't think overloading message names in any way would be a good thing.

@mjstahlberg
Copy link
Member Author

I did not yet need this, retrieving the component in question and using direct method calls was sufficient.

@t4im
Copy link
Contributor

t4im commented Nov 18, 2018

Since messages are a form of inter-component communication, it seems this is a workaround to add convenience methods to specific Entitys. Perhaps it would be better to allow generating some form of delegator into the entities instead.

Something like:

entities:
    Fire:
        delegators:
            Extinguish: Igniteable
        components:
            Igniteable
FireEntity fire = new FireEntity();
fire.Extinguish(0); // -> fire.r_IgniteableComponent.Extinguish(0)

Of course this has the potential to be very verbose in the yaml file if one would be to add delegators to every entity. But so would be adding new message types for everything to components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants