Spy-Shifty / BrokenBricksECS

Rebuild of Unity3D upcoming Entity Component System !OUT OF DEVELOPMENT!
MIT License
162 stars 28 forks source link

ComponentGroup API naming #19

Open acoppes opened 6 years ago

acoppes commented 6 years ago

This is both a question and a proposal, the current ComponentGroup API is GetComponent but it returns a ComponentArray. Shouldn't it be GetComponentArray or GetComponents?

For example, if you read:

var inputs = g.GetComponent<InputComponent> ();

it is not clear, I believe it could be better to identify you want a component array and not a component

I know this could be solved also on the user side buy changing it to:

ComponentArray<InputComponent> inputArray = group.GetComponent<InputComponent> ();

But still the ECS API could help.

Spy-Shifty commented 6 years ago

Well what else should a componentGroup return ;)

Well I could change this but I want to be close to unity's upcoming api

acoppes commented 6 years ago

When it comes out, I will suggest them to change it also ;)