The hierarchy manager could also have search functions. For example, I have frequently seen functions similar to this:
std::list<GameObjects*> manager::FindAllObjects( predicate testFunction );
std::list<GameObjects*> manager::FindAllObjectsInRadius(float range);
std::list<GameObjects*> manager::FindAllObjectsOfType(objectType type);
std::list<GameObjects*> manager::FindAllObjectsOfTypeInRadius(objectType type, float range);
and so on. The list of search functions tends to grow as the engine matures.
Show differencesHistory of post edits
#1frob
Posted 30 November 2012 - 02:27 PM
The hierarchy manager could also have search functions. For example, I have frequently seen functions similar to this:
std::list<GameObjects*> manager::FindAllObjects();
std::list<GameObjects*> manager::FindAllObjectsInRadius(float range);
std::list<GameObjects*> manager::FindAllObjectsOfType(objectType type);
std::list<GameObjects*> manager::FindAllObjectsOfTypeInRadius(objectType type, float range);
std::list<GameObjects*> manager::FindAllObjects();
std::list<GameObjects*> manager::FindAllObjectsInRadius(float range);
std::list<GameObjects*> manager::FindAllObjectsOfType(objectType type);
std::list<GameObjects*> manager::FindAllObjectsOfTypeInRadius(objectType type, float range);