mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Sort AreaStore header
This commit is contained in:
parent
5641da43d6
commit
6e9d71342a
2 changed files with 70 additions and 75 deletions
|
@ -54,19 +54,12 @@ AreaStore *AreaStore::getOptimalImplementation()
|
|||
#endif
|
||||
}
|
||||
|
||||
u16 AreaStore::size() const
|
||||
{
|
||||
return areas_map.size();
|
||||
}
|
||||
|
||||
const Area *AreaStore::getArea(u32 id) const
|
||||
{
|
||||
const Area *res = NULL;
|
||||
std::map<u32, Area>::const_iterator itr = areas_map.find(id);
|
||||
if (itr != areas_map.end()) {
|
||||
res = &itr->second;
|
||||
}
|
||||
return res;
|
||||
AreaMap::const_iterator it = areas_map.find(id);
|
||||
if (it == areas_map.end())
|
||||
return NULL;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -234,7 +227,7 @@ void VectorAreaStore::getAreasInArea(std::vector<Area *> *result,
|
|||
}
|
||||
|
||||
#if 0
|
||||
bool SimpleAreaStore::forEach(bool (*callback)(void *args, Area *a), void *args) const
|
||||
bool SimpleAreaStore::forEach(ForEachCallback callback, void *arg) const
|
||||
{
|
||||
for (size_t i = 0; i < m_areas.size(); ++i) {
|
||||
if (callback(m_areas[i], arg)) {
|
||||
|
@ -308,7 +301,7 @@ void SpatialAreaStore::getAreasInArea(std::vector<Area *> *result,
|
|||
}
|
||||
|
||||
#if 0
|
||||
bool SpatialAreaStore::forEach(bool (*callback)(void *args, Area *a), void *args) const
|
||||
bool SpatialAreaStore::forEach(ForEachCallback callback, void *arg) const
|
||||
{
|
||||
// TODO ?? (this is only needed for serialisation, but libspatial has its own serialisation)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue