예제 #1
0
파일: world.cpp 프로젝트: ribells/cove_yurt
/* =============================================================================
 =============================================================================== */
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;
}
예제 #2
0
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;
}
예제 #3
0
파일: world.cpp 프로젝트: ribells/cove_yurt
/* =============================================================================
 =============================================================================== */
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;
}