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

Method addTile

source/gamemap/TileContainer.cpp:366–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366bool TileContainer::addTile(Tile* t)
367{
368 int x = t->getX();
369 int y = t->getY();
370
371 if (x < getMapSizeX() && y < getMapSizeY() && x >= 0 && y >= 0)
372 {
373 if(mTiles[x][y] != nullptr)
374 {
375 mTiles[x][y]->destroyMesh();
376 delete mTiles[x][y];
377 }
378 mTiles[x][y] = t;
379 return true;
380 }
381
382 return false;
383}
384
385void TileContainer::setTileNeighbors(Tile *t)
386{

Callers 1

readGameMapFromFileFunction · 0.80

Calls 3

destroyMeshMethod · 0.80
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected