AsMultiMap with selector
See original GitHub issueIt looks to me like AsMultiMap
uses some component as a key to reference entities. Is there some way that I can specify a key selector instead of using an entire component?
For example, lets say I have some component:
struct TransformComponent {
Vector3 Position;
Quaternion Rotation;
Entity Parent;
}
If I wanted to get the parent of some component, that’s easy to do by following Parent. But if I wanted to find all children of an entity, how could I construct a query to efficiently perform that lookup? Is this even a viable approach?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
View.AsMultimap (Apache Beam 2.11.0)
@Internal public static class View.AsMultimap<K,V> extends PTransform<PCollection<KV<K,V>>,PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>>.
Read more >View.AsMultimap (Apache Beam 2.29.0)
@Internal public static class View.AsMultimap<K,V> extends PTransform<PCollection<KV<K,V>>,PCollectionView<java.util.Map<K,java.lang.Iterable<V>>>>.
Read more >org.apache.beam.sdk.transforms.View.asMultimap java ...
AsMultimap transform that takes a PCollection as input and produces a PCollectionView mapping each window to its contents as a Map for use...
Read more >Issues · Doraku/DefaultEcs
Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development. - Issues · Doraku/DefaultEcs.
Read more >Index (core 2.35.0 API) - javadoc.io
asMultimap () - Static method in class org.apache.beam.sdk.transforms.View. Returns a View. ... Parser for textual field-access selector.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can provide AsMultiMap with a IEqualityComparer to change what the multimap use for equality. You can also make your component implements
IEquatable<T>
to change the default equality comparer used by the multimap. With both solution you can only take into account theEntity Parent
and the multimap would effectively give you all children for a given entity.Hum I guess it should be possible but we would need a new type
EntityMap<TComponent, TKey>
with aFunc<TComponent, TKey>
selector like in your example (the key should still be part of a component obviously). It would be cool to also allow the key to be produced from multiple components. I will try to play around with this idea.