mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-24 05:17:17 +00:00
nilrider:: remove timer from checkerparam
This commit is contained in:
parent
4d1c3b0956
commit
aec4f78ac6
@ -4,7 +4,7 @@ bool all(checkerparam c) { return c.t->collected_triangles == Flag(isize(c.l->tr
|
|||||||
|
|
||||||
goalchecker basic_check(ld time_limit, ld rev_limit) {
|
goalchecker basic_check(ld time_limit, ld rev_limit) {
|
||||||
return [=] (checkerparam c) {
|
return [=] (checkerparam c) {
|
||||||
if(c.timer > time_limit || c.rev > rev_limit) return grFailed;
|
if(c.t->timer > time_limit || c.rev > rev_limit) return grFailed;
|
||||||
if(all(c)) return grSuccess;
|
if(all(c)) return grSuccess;
|
||||||
return grNone;
|
return grNone;
|
||||||
};
|
};
|
||||||
@ -12,7 +12,7 @@ goalchecker basic_check(ld time_limit, ld rev_limit) {
|
|||||||
|
|
||||||
goalchecker get_any(ld time_limit, ld rev_limit) {
|
goalchecker get_any(ld time_limit, ld rev_limit) {
|
||||||
return [=] (checkerparam c) {
|
return [=] (checkerparam c) {
|
||||||
if(c.timer > time_limit || c.rev > rev_limit) return grFailed;
|
if(c.t->timer > time_limit || c.rev > rev_limit) return grFailed;
|
||||||
if(c.t->collected_triangles) return grSuccess;
|
if(c.t->collected_triangles) return grSuccess;
|
||||||
return grNone;
|
return grNone;
|
||||||
};
|
};
|
||||||
@ -20,7 +20,7 @@ goalchecker get_any(ld time_limit, ld rev_limit) {
|
|||||||
|
|
||||||
goalchecker get_ordered(ld time_limit, ld rev_limit) {
|
goalchecker get_ordered(ld time_limit, ld rev_limit) {
|
||||||
return [=] (checkerparam c) {
|
return [=] (checkerparam c) {
|
||||||
if(c.timer > time_limit || c.rev > rev_limit) return grFailed;
|
if(c.t->timer > time_limit || c.rev > rev_limit) return grFailed;
|
||||||
if(c.t->collected_triangles & (c.t->collected_triangles+1)) return grFailed;
|
if(c.t->collected_triangles & (c.t->collected_triangles+1)) return grFailed;
|
||||||
if(all(c)) return grSuccess;
|
if(all(c)) return grSuccess;
|
||||||
return grNone;
|
return grNone;
|
||||||
@ -29,7 +29,7 @@ goalchecker get_ordered(ld time_limit, ld rev_limit) {
|
|||||||
|
|
||||||
goalchecker yplus_check(ld time_limit, ld rev_limit) {
|
goalchecker yplus_check(ld time_limit, ld rev_limit) {
|
||||||
return [=] (checkerparam c) {
|
return [=] (checkerparam c) {
|
||||||
if(c.timer > time_limit || c.rev > rev_limit) return grFailed;
|
if(c.t->timer > time_limit || c.rev > rev_limit) return grFailed;
|
||||||
if(c.t->where[1] < 0) return grFailed;
|
if(c.t->where[1] < 0) return grFailed;
|
||||||
if(all(c)) return grSuccess;
|
if(all(c)) return grSuccess;
|
||||||
return grNone;
|
return grNone;
|
||||||
@ -38,7 +38,7 @@ goalchecker yplus_check(ld time_limit, ld rev_limit) {
|
|||||||
|
|
||||||
goalchecker fullstop_check(ld time_limit, ld rev_limit) {
|
goalchecker fullstop_check(ld time_limit, ld rev_limit) {
|
||||||
return [=] (checkerparam c) {
|
return [=] (checkerparam c) {
|
||||||
if(c.timer > time_limit || c.rev > rev_limit) return grFailed;
|
if(c.t->timer > time_limit || c.rev > rev_limit) return grFailed;
|
||||||
if(all(c) && c.t->vel == 0) return grSuccess;
|
if(all(c) && c.t->vel == 0) return grSuccess;
|
||||||
return grNone;
|
return grNone;
|
||||||
};
|
};
|
||||||
|
@ -70,7 +70,6 @@ enum eGoalResult { grNone, grSuccess, grFailed };
|
|||||||
struct checkerparam {
|
struct checkerparam {
|
||||||
timestamp *t;
|
timestamp *t;
|
||||||
level *l;
|
level *l;
|
||||||
ld timer;
|
|
||||||
int rev;
|
int rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,8 +67,9 @@ void level::solve() {
|
|||||||
timestamp ts;
|
timestamp ts;
|
||||||
ts.where = point0;
|
ts.where = point0;
|
||||||
ts.collected_triangles = v.collected;
|
ts.collected_triangles = v.collected;
|
||||||
|
ts.timer = 0;
|
||||||
ts.collect(this);
|
ts.collect(this);
|
||||||
checkerparam p {&ts, this, 0, 0};
|
checkerparam p {&ts, this, 0};
|
||||||
auto res = goals[goal_id].check(p);
|
auto res = goals[goal_id].check(p);
|
||||||
if(res == grFailed) continue;
|
if(res == grFailed) continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user