Hello. Im working on RTS game and come to need have “unit_list” something like linked array (multimap) for unit propetries:
- Unit ID (for MP comunications)
- Unit Type
- Object Reference
As i know, Array and Map “Find” function is extremly fast, but if i would make this “unit_list” as blueprint object, then i would have something like 999 Map’s
UnitTypeA - ID, UnitTypeB - ID UnitTypeC - ID
TeamA - ID, TeamB - ID, TeamC - ID
PlayerA - ID, PlayerB - ID, PlayerC - ID
And at the end ID - Object Reference.
So if im say - “Give me all units references of PlayerC!!!”.
The “unit_list” must take values of “PlayerC - ID” map and start to parse “ID - Object Reference” Map to collect references in the “returned array”.
But what if im want to get only TypeB units? So then, “unit_list” must call each object for"Get Unit Type" and check it
or first parse the “UnitTypeB - ID” first and only then, start to collect references.
Sure im not the first one who strike this problem. What is the right solution? C++ Class?