pandora icon indicating copy to clipboard operation
pandora copied to clipboard

Getting entities from category + Path

Open pietru2004 opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Making Tech Tree

Describe the solution you'd like Ability to get category entities similar to get_node("path").get_children() Something like Pandora.get_category("Path").get_entities()

Describe alternatives you've considered pasting each available tech into array, I mean custom_class.property_name

Ref image to my setup... obraz obraz obraz

pietru2004 avatar Nov 03 '23 19:11 pietru2004

This should be doable with https://github.com/bitbrain/pandora/issues/63:

var category = Pandora.get_category(Categories.MY_CATEGORY)
var all_entities_of_category = Pandora.get_all_entities(category)

The issue with paths is that they can update, e.g. once you move items around, paths will just break. That's why I want to introduce the "reference categories by ids" approach, as it is more robust and less prone to errors.

bitbrain avatar Nov 06 '23 16:11 bitbrain

hm... well I was thinking of acase when you are set and know that X path won't move... still that is good way to get it... however now question is will Categories.MY_CATEGORY be always automatically generated ?

Also this should spare me doing this... obraz I mean adding items by hand, cause I want to load all ids once and store it in Autoload DataLib, it is used for quicker data/id access I store entities under IDs in Dictionary bellow...

pietru2004 avatar Nov 06 '23 18:11 pietru2004

@pietru2004 you can already do this for entity ids, but not categories. There is a toggle on the bottom of the category config.

bitbrain avatar Nov 07 '23 16:11 bitbrain

I already use that, as you can see from screen

pietru2004 avatar Nov 07 '23 16:11 pietru2004