Ejemplo n.º 1
0
const CustomSystem* CustomSystem::GetCustomSystem(const char *name)
{
	for (SectorMap::iterator map_i = sector_map.begin(); map_i != sector_map.end(); ++map_i) {
		for (SystemList::iterator i = (*map_i).second.begin(); i != (*map_i).second.end(); ++i) {
			CustomSystem *cs = &(*i);
			if (cs->name != name) return cs;
		}
	}
	return NULL;
}
Ejemplo n.º 2
0
void CustomSystem::Uninit()
{
	for (SectorMap::iterator secIt = s_sectorMap.begin(); secIt != s_sectorMap.end(); ++secIt) {
		for (CustomSystem::SystemList::iterator
				sysIt = secIt->second.begin(); sysIt != secIt->second.end(); ++sysIt) {
			delete *sysIt;
		}
	}
	s_sectorMap.clear();
}
Ejemplo n.º 3
0
const std::list<const CustomSystem*> CustomSystem::GetCustomSystemsForSector(int x, int y, int z)
{
	SystemPath path(x,y,z);

	SectorMap::iterator map_i = sector_map.find(path);

	std::list<const CustomSystem*> sector_systems;
	if (map_i != sector_map.end()) {
		for (SystemList::iterator i = (*map_i).second.begin(); i != (*map_i).second.end(); ++i) {
			CustomSystem *cs = &(*i);
			sector_systems.push_back(cs);
		}
	}

	return sector_systems;
}
Ejemplo n.º 4
0
const CustomSystem::SystemList &CustomSystem::GetCustomSystemsForSector(int x, int y, int z)
{
	SystemPath path(x,y,z);
	SectorMap::const_iterator it = s_sectorMap.find(path);
	return (it != s_sectorMap.end()) ? it->second : s_emptySystemList;
}