private static int encodeValue(Hands.Type type, int[][] indexes) { int result = Array.IndexOf(Enum.GetValues(type.GetType()), type); int i = 0, j = 0; while (j < Hands.CARDS) { for (int k = 0; k < indexes[i][REPEATS_INDEX]; k++) { result = result * ENCODE_BASE + indexes[i][RANK_INDEX]; j++; } i++; } return(result); }