public void move(Move m)
	{
		int orig = (7-m.r0)*8 + (7-m.c0);
		long origMask = ~(1L << orig);
		int dest = (7-m.rf)*8 + (7-m.cf);
		long destMask = ~(1L << dest);

		if ((getPawns() & (1L << orig)) != 0)
		{
			setPawns(getPawns() & origMask);
			setPawns(getPawns() | (1L << dest));
			setKnights(getKnights() & ~(1L << dest));
			setBishops(getBishops() & ~(1L << dest));
			setRooks(getRooks() & ~(1L << dest));
			setQueens(getQueens() & ~(1L << dest));
			setKings(getKings() & ~(1L << dest));
		}
		else if ((getKnights() & (1L << orig)) != 0)
		{
			setKnights(getKnights() & origMask);
			setKnights(getKnights() | (1L << dest));
			setPawns(getPawns() & ~(1L << dest));
			setBishops(getBishops() & ~(1L << dest));
			setRooks(getRooks() & ~(1L << dest));
			setQueens(getQueens() & ~(1L << dest));
			setKings(getKings() & ~(1L << dest));
		}
		else if ((getBishops() & (1L << orig)) != 0)
		{
			setBishops(getBishops() & origMask);
			setBishops(getBishops() | (1L << dest));
			setPawns(getPawns() & ~(1L << dest));
			setKnights(getKnights() & ~(1L << dest));
			setRooks(getRooks() & ~(1L << dest));
			setQueens(getQueens() & ~(1L << dest));
			setKings(getKings() & ~(1L << dest));
		}
		else if ((getRooks() & (1L << orig)) != 0)
		{
			setRooks(getRooks() & origMask);
			setRooks(getRooks() | (1L << dest));
			setPawns(getPawns() & ~(1L << dest));
			setKnights(getKnights() & ~(1L << dest));
			setBishops(getBishops() & ~(1L << dest));
			setQueens(getQueens() & ~(1L << dest));
			setKings(getKings() & ~(1L << dest));
		}
		else if ((getQueens() & (1L << orig)) != 0)
		{
			setQueens(getQueens() & origMask);
			setQueens(getQueens() | (1L << dest));
			setPawns(getPawns() & ~(1L << dest));
			setKnights(getKnights() & ~(1L << dest));
			setBishops(getBishops() & ~(1L << dest));
			setRooks(getRooks() & ~(1L << dest));
			setKings(getKings() & ~(1L << dest));
		}
		else if ((getKings() & (1L << orig)) != 0)
		{
			setKings(getKings() & origMask);
			setKings(getKings() | (1L << dest));
			setPawns(getPawns() & ~(1L << dest));
			setKnights(getKnights() & ~(1L << dest));
			setBishops(getBishops() & ~(1L << dest));
			setRooks(getRooks() & ~(1L << dest));
			setQueens(getQueens() & ~(1L << dest));
		}
		else
			return; //not a valid move (no piece selected)

		if (m_turn == Definitions.Color.WHITE)
		{
			setWhite(getWhite() & origMask);
			setBlack(getBlack() & destMask);
			setWhite(getWhite() | (1L << dest));
		}
		else
		{
			setBlack(getBlack() & origMask);
			setWhite(getWhite() & destMask);
			setBlack(getBlack() | (1L << dest));
		}		
		m_turn = Definitions.flip(m_turn);
	}