Code Monkey home page Code Monkey logo

Comments (3)

nyvs avatar nyvs commented on June 23, 2024 2

I managed to do it like this:

#[system]
fn beam_array_damage_update(
	targets: &mut Query<(Entity, &mut Hull, Option<&mut Shield>)>, 
	sender: &mut Query<(&BeamArray, &TargetingConsole)>, 
	world: &mut SubWorld,
	#[resource] dt: &DeltaTime
) {
	...
}

I didn't know this was even a thing, until I read this issue and the amethyst docs linked in it.

But as you said for a complex filter my solution probably won't work.

from legion.

nyvs avatar nyvs commented on June 23, 2024

For the example's sake, lets try to add in a filter that optionally gives me the Shield component

from legion.

zedrian avatar zedrian commented on June 23, 2024

I was not working with filters by myself yet, but as I can see from the #[system] documentation you can only apply filters to a single query (when the system is defined with #[system(for_each)] or #[system(par_for_each)]). The example you provided attempts to work with two different queries at the same time, and the #[system] macro does not have a way to describe filters in that case.

from legion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.