If you end up with 600 of almost anything, it probably means there’s a better way of doing things ![]()
It might be better to represent this in some sort of data structure.
While it might be tempting to use structs, I would advise against that. Structs can be a bit of a nightmare, and would make the situation worse.
What you basically have here are skills ( on or off ) and connections with cost.
You could do the whole thing with just a set of arrays:
- Skill array ( possibly enums )
- Bool array ( true if a skill is enabled )
- Connections, which could be done using a map ( dictionary )
- Something for the costs also, I’m not sure how that fits in right now ( I don’t get where the cost is in the structure )
Then you need to re-write your algorithm to cope with the new structure. Loops could pop up quite a lot.
This is just one way of doing it, there are many I assume. Very possible, but you’d need to be quite neat ![]()