MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / activeSpotCheckChange

Method activeSpotCheckChange

source/rooms/Room.cpp:452–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void Room::activeSpotCheckChange(ActiveSpotPlace place, const std::vector<Tile*>& originalSpotTiles,
453 const std::vector<Tile*>& newSpotTiles)
454{
455 // We create the non existing tiles
456 for(std::vector<Tile*>::const_iterator it = newSpotTiles.begin(); it != newSpotTiles.end(); ++it)
457 {
458 Tile* tile = *it;
459 if(std::find(originalSpotTiles.begin(), originalSpotTiles.end(), tile) == originalSpotTiles.end())
460 {
461 // The tile do not exist
462 BuildingObject* ro = notifyActiveSpotCreated(place, tile);
463 if(ro != nullptr)
464 {
465 // The room wants to build a room onject. We add it to the gamemap
466 addBuildingObject(tile, ro);
467 ro->createMesh();
468 }
469 }
470 }
471 // We remove the suppressed tiles
472 for(std::vector<Tile*>::const_iterator it = originalSpotTiles.begin(); it != originalSpotTiles.end(); ++it)
473 {
474 Tile* tile = *it;
475 if(std::find(newSpotTiles.begin(), newSpotTiles.end(), tile) == newSpotTiles.end())
476 {
477 // The tile has been removed
478 notifyActiveSpotRemoved(place, tile);
479 }
480 }
481}
482
483BuildingObject* Room::notifyActiveSpotCreated(ActiveSpotPlace place, Tile* tile)
484{

Callers

nothing calls this directly

Calls 1

createMeshMethod · 0.80

Tested by

no test coverage detected