Anders429 / Anders429/brood

Possibility of a World::retain() method?

Đang mở
#229 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
A - Querying C - Enhancement P - Low
Ngôn ngữ chính
Rust
Star
41
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi, first off, just want to say I love this library, it's absolutely fantastic and exactly what I've been looking for. Also the documentation is amazing, so thank you so much for putting the effort in there.

I think a retain(..) interface would be incredibly handy to have, I find myself writing the following boilerplate quite a lot and there are definitely optimisations that could be made under the hood:

```rust
let mut entities_to_remove = vec![];
for result!(identifier, data) in world.query(query).iter {
if data.health < 0.0 {
entities_to_remove.push(identifier);
}
}
for identifier in entities_to_remove {
world.remove(identifier);
}
```

Also, do you take pull requests? I might take a shot at implementing the above myself if you think it wouldn't be too difficult of a change to make.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.