public static long ToHandId(HandIdPlayType playType, HandIdGameType gameType, HandIdModeType modeType, long handHistoryId) { return ((long)((int)playType) << (8 + 4 + 8 + 40)) + ((long)((int)gameType) << (4 + 8 + 40)) + ((long)((int)modeType) << (8 + 40)) + handHistoryId; }
public static long[] GetHandIdRange(HandIdPlayType playType, HandIdGameType gameType, HandIdModeType modeType) { var from = ((long)((int)playType) << (8 + 4 + 8 + 40)) + ((long)((int)gameType) << (4 + 8 + 40)) + ((long)((int)modeType) << (8 + 40)); var to = ((long)((int)playType) << (8 + 4 + 8 + 40)) + ((long)((int)gameType) << (4 + 8 + 40)) + (((long)((int)modeType + 1)) << (8 + 40)) - 1; return new[] { from, to }; }