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

Pool attribute name is not very descriptive #17

Closed
chrischu opened this issue Aug 9, 2015 · 4 comments
Closed

Pool attribute name is not very descriptive #17

chrischu opened this issue Aug 9, 2015 · 4 comments

Comments

@chrischu
Copy link
Contributor

chrischu commented Aug 9, 2015

In my opinion the generated attributes that associate a component with a pool is not very descriptive. Imagine I have a pool called "Core", then the attribute will also be called "Core".

I think it would be better to have a PoolAttribute that takes an enum value and those enum values are generated by the code generator.

i.e. instead of having an attribute [Core] it would be an attribute [Pool(Pools.Core)].

@chrischu
Copy link
Contributor Author

chrischu commented Aug 9, 2015

I just tried it and realised that enums cannot be partial, so instead of an enum a class with integer ids could be used like this:

public class PoolIds {
    public const int Core = 1;
}

@sschmid
Copy link
Owner

sschmid commented Aug 9, 2015

Sounds like a good idea! I'll give it a try.

@sschmid
Copy link
Owner

sschmid commented Aug 23, 2015

I agree, [Pool(Pools.Core)] is more descriptive. On the other hand these attributes are used for a very specific case and only in entitas components. It's a little less code to write with the current impl. which is nice, if you're writing this over and over again.

[Meta, UI, SingleEntity]
public class MyComponent : IComponent {}

@sschmid
Copy link
Owner

sschmid commented Aug 23, 2015

If you don't mind, I'd just leave it like it is for now.

@sschmid sschmid closed this as completed Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants