Ejemplo n.º 1
0
void bGroup::addFromClick(block & t, int _x, int _y)
{
	for (unsigned int j=0; j<t.blocksIn.size(); j++) {
		if (!inHand&&!ddopen&&!t.ddSelected){
			int blk=0;
			if(blk=t.blocksIn[j].onBlockIn(_x, _y)){
				addFromClick(t.blocksIn[j].blocksIn[blk-1], _x, _y);
			}
			else if(t.blocksIn[j].clickDown(_x,_y)) {
				int cur=add(t.passBlocks(OF_BLOCK_IN,j));
				inHand=true;
				dispx = blocks[cur].x-_x;
				dispy = blocks[cur].y-_y;
			}
		}
	}
	for (unsigned int j=0; j<t.blocksOn.size(); j++) {
		if (!inHand&&!ddopen&&!t.ddSelected){
			int blk=0;
			if(blk=t.blocksOn[j].onBlockIn(_x, _y)){
				addFromClick(t.blocksOn[j].blocksIn[blk-1], _x, _y);
			}
		}
	}
}
Ejemplo n.º 2
0
void block::addIn(block t,int pos){
	vector<block> k=t.passBlocks(OF_BLOCK_ON, 0);
	blocksIn.insert(blocksIn.begin()+pos,block(t));
	blocksIn.insert(blocksIn.begin()+pos+1,k.begin(),k.end());
	blocksIn[pos].grabbed=false;
}