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

Document behaviour of .insert() and .with() when component already exists #475

Closed
zesterer opened this issue Sep 19, 2018 · 2 comments
Closed

Comments

@zesterer
Copy link
Contributor

zesterer commented Sep 19, 2018

Currently, the docs specify the following:

image

It would be nice to know what the behaviour of the following is, or at least whether the behaviour is undefined or not.

world.create_entity()
    .with(Pos(0, 0))
    .with(Pos(1, 1))
    .build();
@Aceeri
Copy link
Member

Aceeri commented Sep 19, 2018

Consecutive with and insert overwrite the previous component: https://github.com/slide-rs/specs/blob/master/src/storage/mod.rs#L404

Would agree it might be nice to have defined documentation for that, but I think it is pretty standard to overwrite.

@zesterer
Copy link
Contributor Author

Thanks for that. Just wanted to make sure this applied in all cases.

bors bot added a commit that referenced this issue Sep 20, 2018
477: Insertion documentation r=Xaeroxe a=Aceeri

Fixes #475

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/slide-rs/specs/477)
<!-- Reviewable:end -->


Co-authored-by: Aceeri <conmcclusk@gmail.com>
@bors bors bot closed this as completed in #477 Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants