bot/src/bitboard.cpp
/*
* Convert the I, Z, S pieces to their alternative forms
* Useful in move generator
*/
Convert the I, Z, S pieces to their alternative forms
Useful in move generator
Convert the I Z S pieces to their alternative forms Useful in move generator
void piece_data::mirror()
{
	switch (type)
	{
	case PIECE_I:
		switch (rotation)
		{
		case PIECE_UP:
			rotation = PIECE_DOWN;
			++x;
			break;
		case PIECE_RIGHT:
			rotation = PIECE_LEFT;
			--y;
			break;
		default:
			break;
		}
		break;
	case PIECE_S:
		switch (rotation)
		{
		case PIECE_UP:
			rotation = PIECE_DOWN;
			++y;
			break;
		case PIECE_RIGHT:
			rotation = PIECE_LEFT;
			++x;
			break;
		default:
			break;
		}
		break;
	case PIECE_Z:
		switch (rotation)
		{
		case PIECE_UP:
			rotation = PIECE_DOWN;
			++y;
			break;
		case PIECE_RIGHT:
			rotation = PIECE_LEFT;
			++x;
			break;
		default:
			break;
		}
		break;
	default:
		break;
	}
}
void piece_data :: mirror ( ) { switch ( type ) { case PIECE_I : switch ( rotation ) { case PIECE_UP : rotation = PIECE_DOWN ; ++ x ; break ; case PIECE_RIGHT : rotation = PIECE_LEFT ; -- y ; break ; default : break ; } break ; case PIECE_S : switch ( rotation ) { case PIECE_UP : rotation = PIECE_DOWN ; ++ y ; break ; case PIECE_RIGHT : rotation = PIECE_LEFT ; ++ x ; break ; default : break ; } break ; case PIECE_Z : switch ( rotation ) { case PIECE_UP : rotation = PIECE_DOWN ; ++ y ; break ; case PIECE_RIGHT : rotation = PIECE_LEFT ; ++ x ; break ; default : break ; } break ; default : break ; } }
Convert the I, Z, S pieces to their alternative forms
Useful in move generator
Convert the I Z S pieces to their alternative forms Useful in move generator