mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	get_portal and mirror moved here
This commit is contained in:
		| @@ -79,6 +79,9 @@ vector<int> get_path(coord c) { | ||||
|   return {0,0,0,co.first,0,0,0,co.second,0,0,0}; | ||||
|   } | ||||
|  | ||||
| coord get_portal(coord x); | ||||
| void mirror(coord& at, vect2& prev); | ||||
|  | ||||
| void snapshot(); | ||||
| void from_map(coord co, struct tile& t); | ||||
| void is_clone(struct tile& orig, struct tile& clone); | ||||
| @@ -90,6 +93,26 @@ void is_clone(struct tile& orig, struct tile& clone); | ||||
|  | ||||
| namespace seuphorica { | ||||
|  | ||||
| coord get_portal(coord x) { | ||||
|   if(get_gigantic(x) != x) { | ||||
|     auto x1 = get_gigantic(x); | ||||
|     auto v = gigacover(x1); | ||||
|     for(int i=0; i<seuphorica::isize(v); i++) if(v[i] == x) | ||||
|       return gigacover(get_portal(x1))[i]; | ||||
|     } | ||||
|   return portals.at(x); | ||||
|   } | ||||
|  | ||||
| void mirror(coord& at, vect2& prev) { | ||||
|   if(get_gigantic(at) != at) { | ||||
|     auto at1 = get_gigantic(at); | ||||
|     auto v = gigacover(at1); | ||||
|     vector<int> reindex = {0,3,6,1,4,7,2,5,8}; | ||||
|     for(int i=0; i<9; i++) if(v[i] == at) { at = v[reindex[i]]; prev.at = at; break; } | ||||
|     } | ||||
|   prev = get_mirror(prev); | ||||
|   } | ||||
|  | ||||
| void compute_score(); | ||||
|  | ||||
| void compute_size() {} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue