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

Prevent using the same component multiple times in any operations, through panic #357

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

mlange-42
Copy link
Owner

@mlange-42 mlange-42 commented Feb 2, 2024

Disallows things like these:

e := world.NewEntity(posID, posID) // add the same thing twice
world.Exchange(e, []ID{posID}, []ID{posID}) // add and remove the same thing

Which would have caused bugs when used.

Fixes #349

@mlange-42 mlange-42 added the bug Something isn't working label Feb 2, 2024
@mlange-42 mlange-42 self-assigned this Feb 2, 2024
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 7750171565

  • 0 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 7750012433: 0.0%
Covered Lines: 6159
Relevant Lines: 6159

💛 - Coveralls

@mlange-42 mlange-42 merged commit 6f8013c into main Feb 2, 2024
18 checks passed
@mlange-42 mlange-42 deleted the fix-no-duplicates branch February 2, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exchange with same component(s) in add and rem?
2 participants