1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-18 23:47:40 +00:00

devmods:: rulegen-tests:: time measuring improvements (movecount and attempts)

This commit is contained in:
Zeno Rogue
2021-11-01 17:14:01 +01:00
parent 1e2ffd611c
commit 1a74241cd9
2 changed files with 54 additions and 7 deletions

View File

@@ -79,6 +79,8 @@ static const flagtype w_bfs = Flag(17); /*< compute distances using BFS */
EX flagtype flags = 0;
EX int64_t movecount;
#if HDR
struct tcell* tmove(tcell *c, int d);
@@ -104,11 +106,11 @@ struct tcell {
/** sometimes we find out that multiple tcells represent the same actual cell -- in this case we unify them; unified_to is used for the union-find algorithm */
walker<tcell> unified_to;
int degree() { return type; }
connection_table<tcell> c;
tcell*& move(int d) { return c.move(d); }
tcell*& modmove(int d) { return c.modmove(d); }
tcell* cmove(int d) { return tmove(this, d); }
tcell* cmodmove(int d) { return tmove(this, c.fix(d)); }
connection_table<tcell> c;
tcell*& move(int d) { movecount++; return c.move(d); }
tcell*& modmove(int d) { movecount++; return c.modmove(d); }
tcell* cmove(int d) { movecount++; return tmove(this, d); }
tcell* cmodmove(int d) { movecount++; return tmove(this, c.fix(d)); }
tcell() { }
};