Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

one to many relationship unit tests #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Felecarpp
Copy link
Contributor

Hello,
I need to create relationships between my entities in my project. I have read this thread (#62) and I would like to propose a way to build them using esper.
The key idea is to add a same component instance (called a group) to many entities. This works already fine with esper but not any test assure it over the long-term. So this PR only adds unit tests.

add a test suite to check a relationship implementation works
this adds a constraint on esper because this implementation use a same component instance (called group) for many entities
@Felecarpp
Copy link
Contributor Author

Finally, I found another way to implement it which don't need to add the same instance of a component to many entities.

the first idea

item 1 character item 2
Inventory <-- Hold Inventory (the same instance)

the new one

item 1 character item 2
Belong --> Inventory <-- Belong

for the farm/plant question (#79)

plant 1 farm plant 2
Rooted --> Plantation <-- Rooted

The only oddity remaining is that a component has another component as an attribute. This allows to do not use an entity ID instead or to use a complex identifier system.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant