1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-02-27 10:29:43 +00:00

more elegant cellwalkers

This commit is contained in:
Zeno Rogue
2018-03-24 12:59:01 +01:00
parent 2c09c5ee56
commit ac37b6df99
20 changed files with 371 additions and 467 deletions

View File

@@ -300,8 +300,7 @@ struct cellcrawler {
for(int i=0; i<size(data); i++) {
cellwalker cw0 = data[i].orig;
for(int j=0; j<cw0.c->type; j++) {
cellwalker cw = cw0;
cwspin(cw, j); cwstep(cw);
cellwalker cw = cw0 + j + wstep;
if(!getNeuron(cw.c)) continue;
store(cw, i, j);
}
@@ -317,9 +316,9 @@ struct cellcrawler {
cellcrawlerdata& s = data[i];
s.target = data[s.from].target;
if(!s.target.c) continue;
cwspin(s.target, s.spin);
s.target += s.spin;
if(cwstepcreates(s.target)) s.target.c = NULL;
else cwstep(s.target);
else s.target += wstep;
}
}
};