Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting entities from category + Path #153

Open
pietru2004 opened this issue Nov 3, 2023 · 4 comments
Open

Getting entities from category + Path #153

pietru2004 opened this issue Nov 3, 2023 · 4 comments
Labels
📦 feature A new piece of functionality

Comments

@pietru2004
Copy link

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

@bitbrain
Copy link
Owner

bitbrain commented Nov 6, 2023

This should be doable with #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.

@pietru2004
Copy link
Author

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...

@bitbrain
Copy link
Owner

bitbrain commented Nov 7, 2023

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

@pietru2004
Copy link
Author

I already use that, as you can see from screen

@bitbrain bitbrain added the 📦 feature A new piece of functionality label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 feature A new piece of functionality
Projects
None yet
Development

No branches or pull requests

2 participants