Ejemplo n.º 1
0
Void Planet::DestroyMoonRegion( MoonID iMoonID, const RegionCoords & vRegionCoords )
{
    Assert( iMoonID < m_iMoonCount );
    RegionMap * pMap = m_arrMoons[iMoonID];

    if ( pMap->Contains(vRegionCoords) ) {
        Region * pRegion = (*pMap)[vRegionCoords];

        BlockWorldFn->SelectMemory( TEXT("Regions") );
        Delete( pRegion );
        BlockWorldFn->UnSelectMemory();

        Bool bRemoved = pMap->Remove( vRegionCoords );
        Assert( bRemoved );
    }
}
Ejemplo n.º 2
0
Void Planet::DestroyRegion( RegionLayer iRegionLayer, const RegionCoords & vRegionCoords )
{
    RegionMap * pMap = NULL;
    switch( iRegionLayer ) {
        case REGION_LAYER_UNDERGROUND: pMap = &m_mapUndergroundRegions; break;
        case REGION_LAYER_SURFACE:     pMap = &m_mapSurfaceRegions;     break;
        case REGION_LAYER_ATMOSPHERE:  pMap = &m_mapAtmosphereRegions;  break;
        default: Assert( false ); break;
    }

    if ( pMap->Contains(vRegionCoords) ) {
        Region * pRegion = (*pMap)[vRegionCoords];

        BlockWorldFn->SelectMemory( TEXT("Regions") );
        Delete( pRegion );
        BlockWorldFn->UnSelectMemory();

        Bool bRemoved = pMap->Remove( vRegionCoords );
        Assert( bRemoved );
    }
}