/* ============================================================================= =============================================================================== */ bool CWorld::addTerrain(CTerrainLayer &Terrain, int iNdx) { if (!Terrain.getName().size()) Terrain.setName(getFileNameBase(Terrain.getLink())); if (!Terrain.getName().size()) Terrain.setName("New Terrain"); if (getTerrainSet().getTerrainLayerIndex(Terrain.getName()) != -1) { string str; for (int i = 1; getTerrainSet().getTerrainLayerIndex(str = getNewName(Terrain.getName(), i)) != -1; i++); Terrain.setName(str); } bool bRet = getTerrain().addTerrain(Terrain, iNdx); return bRet; }
std::set<int> Player::getNeighbours(){ std::set<int> neighbours; for (std::pair<int, efc::BoardElem> i: elems.items_map) { std::set<int> terrain = getTerrainSet(); std::set<int> neighboursVector(efc::getNeighbours(i.second.pos)); for (int j: neighboursVector) { if ((elems.items_map.count(j) == 0) && (terrain.count(j)==0)) { neighbours.insert(j); } } } return neighbours; }
/* ============================================================================= =============================================================================== */ bool CWorld::moveRec(int iTag, int iRec) { bool bSuccess = false; // world objects if (iTag == ID_TERRAIN) bSuccess = getTerrainSet().moveTerrainLayerUp(iRec); else if (iTag == ID_TEXTURES) bSuccess = getTextureSet().moveTextureLayerUp(iRec); else if (iTag == ID_LAYOUTS) bSuccess = getLayoutSet().moveLayoutLayerUp(iRec); else if (iTag == ID_DATASETS) bSuccess = getDataSet().moveDataLayerUp(iRec); else if (iTag == ID_VIEWS) bSuccess = getViewSet().moveViewLayerUp(iRec); return bSuccess; }