Skip to content

impl ReadOnlyFetch for Or, FetchOr, and FetchMutated#763

Merged
cart merged 1 commit intobevyengine:masterfrom
memoryruins:read_only_fetch
Nov 2, 2020
Merged

impl ReadOnlyFetch for Or, FetchOr, and FetchMutated#763
cart merged 1 commit intobevyengine:masterfrom
memoryruins:read_only_fetch

Conversation

@memoryruins
Copy link
Copy Markdown
Contributor

@memoryruins memoryruins commented Nov 1, 2020

ReadOnlyFetch is now implemented on Or and FetchOr.
An impl for FetchMutated has been added for parity with FetchChanged and FetchAdded.

// previously would error due to missing implementations
let entities = world
    .query::<(Or<(Mutated<A>, Changed<B>, Added<C>)>, Entity)>()
    .map(|((_a, _b, _c), e)| e)
    .collect::<Vec<Entity>>();

If it was intentional to leave these implementations out in #741, I can change this PR a source comment about it.

Fixes #762

@memoryruins memoryruins added the A-ECS Entities, components, systems, and events label Nov 1, 2020
@cart cart merged commit f81208a into bevyengine:master Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query using the Or operator do not provide .iter() method, only iter_mut().

2 participants