mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00: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>
|
template<class T, class U>
|
||||||
void virtualRebase(cell*& base, T& at, bool tohex, const U& check) {
|
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) {
|
if((euclid || sphere) && WDIM == 2) {
|
||||||
again:
|
again:
|
||||||
if(euwrap) for(int i=0; i<6; i++) {
|
if(euwrap) for(int i=0; i<6; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user