mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-24 02:17:40 +00:00
reg3:: rule:: optimized link_structures
This commit is contained in:
11
reg3.cpp
11
reg3.cpp
@@ -914,6 +914,8 @@ EX namespace reg3 {
|
|||||||
|
|
||||||
map<address, set<address>> nonlooping_earlier_states;
|
map<address, set<address>> nonlooping_earlier_states;
|
||||||
|
|
||||||
|
vector<vector<int>> possible_states;
|
||||||
|
|
||||||
void find_mappings() {
|
void find_mappings() {
|
||||||
auto &nles = nonlooping_earlier_states;
|
auto &nles = nonlooping_earlier_states;
|
||||||
nles.clear();
|
nles.clear();
|
||||||
@@ -971,6 +973,10 @@ EX namespace reg3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBB(DF_GEOM, ("removed cases = ", isize(bfs)));
|
DEBB(DF_GEOM, ("removed cases = ", isize(bfs)));
|
||||||
|
|
||||||
|
possible_states.resize(qstate);
|
||||||
|
for(auto& p: nonlooping_earlier_states)
|
||||||
|
possible_states[p.first.first].push_back(p.first.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
hrmap_reg3_rule() : fp(0) {
|
hrmap_reg3_rule() : fp(0) {
|
||||||
@@ -1212,10 +1218,7 @@ EX void link_structures(heptagon *h, heptagon *alt, hstate firststate) {
|
|||||||
alt->fiftyval = cm->root[alt->fieldval];
|
alt->fiftyval = cm->root[alt->fieldval];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vector<int> choices;
|
vector<int>& choices = cm->possible_states[alt->fieldval];
|
||||||
for(auto p: cm->nonlooping_earlier_states)
|
|
||||||
if(p.first.first == alt->fieldval)
|
|
||||||
choices.push_back(p.first.second);
|
|
||||||
vector<int> choices2;
|
vector<int> choices2;
|
||||||
for(auto c: choices) {
|
for(auto c: choices) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user