Skip to content

Accessing views in one specific component's order #832

Answered by skypjack
cmartel asked this question in Q&A
Discussion options

You must be logged in to vote

I think what you're looking for is the use<T> function of the view class:

auto priority_view = Registry.view<const Priority, const DataIn, DataOut>().use<priority>(); // use<T> returns a new view
for (auto [E, P, In, Out] : priority_view.each()) { ... }

In this case, entities and components are returned with the order of the Priority component.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@cmartel
Comment options

@skypjack
Comment options

@cmartel
Comment options

@KyrietS
Comment options

@skypjack
Comment options

Answer selected by cmartel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question open question
3 participants