src/Hexxagon/HexxagonBoard.cpp
// sets a color of a stone and according to this returns
// a vector of neighbours which have to switch their color too

sets a color of a stone and according to this returns
a vector of neighbours which have to switch their color too
sets a color of a stone and according to this returns a vector of neighbours which have to switch their color too
vector<int> HexxagonBoard::setColor(int iIndex, int iColor)
{
	vector<int> retVal;
	if (vecStones[iIndex]){
		vecStones[iIndex]->setColor(iColor);
		retVal.insert(retVal.end(),iIndex);
		if (iColor!=0)
		{
			for (int x=0;x<HEX_NUM_STONE_NEIGHBOURS;x++)
			{
				int n=vecStones[iIndex]->getNeighbour(x);
				if (n!=-1){
					int tmpCol=vecStones[n]->getColor();
					if (tmpCol==-iColor){
						retVal.insert(retVal.end(),n);
					}
				}
			}
		}
	}
	return retVal;
}
vector < int > HexxagonBoard :: setColor ( int iIndex , int iColor ) { vector < int > retVal ; if ( vecStones [ iIndex ] ) { vecStones [ iIndex ] -> setColor ( iColor ) ; retVal . insert ( retVal . end ( ) , iIndex ) ; if ( iColor != 0 ) { for ( int x = 0 ; x < HEX_NUM_STONE_NEIGHBOURS ; x ++ ) { int n = vecStones [ iIndex ] -> getNeighbour ( x ) ; if ( n != -1 ) { int tmpCol = vecStones [ n ] -> getColor ( ) ; if ( tmpCol == - iColor ) { retVal . insert ( retVal . end ( ) , n ) ; } } } } } return retVal ; }
sets a color of a stone and according to this returns
a vector of neighbours which have to switch their color too
sets a color of a stone and according to this returns a vector of neighbours which have to switch their color too