Result result;
int opening_num, white_elo, black_elo;
time_t timestamp;
+ long start_position;
bool operator< (const Element& other) const {
return bpfen < other.bpfen;
int opening_num, white_elo, black_elo;
time_t timestamp;
+ long start_position;
if (fread(&white_elo, sizeof(white_elo), 1, fp) != 1) {
perror("fread()");
//exit(1);
//exit(1);
break;
}
+ if (fread(&start_position, sizeof(start_position), 1, fp) != 1) {
+ perror("fread()");
+ //exit(1);
+ break;
+ }
+
l = getc(fp);
if (l == -1) {
}
int bucket = hash_key_to_bucket(bpfen.data(), bpfen.size(), num_buckets);
- elems[bucket].emplace_back(Element {std::move(bpfen), std::move(move), Result(r), opening_num, white_elo, black_elo, timestamp});
+ elems[bucket].emplace_back(Element {std::move(bpfen), std::move(move), Result(r), opening_num, white_elo, black_elo, timestamp, start_position});
++num_elems;
}
fclose(fp);
c.set_first_timestamp(e.timestamp);
}
c.set_opening_num(e.opening_num);
+ c.set_pgn_start_position(e.start_position);
}
if (!moves.count(e.move)) {
moves.insert(e.move);