mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 09:50:34 +00:00
product:: virtualRebase
This commit is contained in:
parent
201098efe9
commit
6c75c2687d
@ -242,6 +242,17 @@ struct horo_distance {
|
||||
|
||||
template<class T, class U>
|
||||
void virtualRebase(cell*& base, T& at, bool tohex, const U& check) {
|
||||
if(prod) {
|
||||
auto w = product::get_where(base);
|
||||
auto d = product_decompose(check(at)).first;
|
||||
at = mscale(at, -d);
|
||||
product::in_underlying_map([&] { virtualRebase(w.first, at, tohex, check); });
|
||||
if(d > cgi.plevel / 2) { w.second++; d -= cgi.plevel; }
|
||||
if(d < -cgi.plevel / 2) { w.second--; d += cgi.plevel; }
|
||||
at = mscale(at, +d);
|
||||
base = product::get_at(w.first, w.second);
|
||||
return;
|
||||
}
|
||||
if((euclid || sphere) && WDIM == 2) {
|
||||
again:
|
||||
if(euwrap) for(int i=0; i<6; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user