mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-30 07:17:03 +00:00
introduced rulegen.cpp which generates strict_tree_rules for arb
This commit is contained in:
parent
bb3fbc5256
commit
c53270ca16
@ -140,6 +140,7 @@ EX bool grailWasFound(cell *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX int default_levs() {
|
EX int default_levs() {
|
||||||
|
if(arb::in()) return 2;
|
||||||
if(IRREGULAR)
|
if(IRREGULAR)
|
||||||
return 1;
|
return 1;
|
||||||
if(S3 >= OINF)
|
if(S3 >= OINF)
|
||||||
@ -1376,7 +1377,7 @@ EX int wallchance(cell *c, bool deepOcean) {
|
|||||||
/** \brief should we generate the horocycles in the current geometry? */
|
/** \brief should we generate the horocycles in the current geometry? */
|
||||||
EX bool horo_ok() {
|
EX bool horo_ok() {
|
||||||
if(INVERSE) return false;
|
if(INVERSE) return false;
|
||||||
if(currentmap->strict_tree_rules()) return false;
|
if(currentmap->strict_tree_rules()) return true;
|
||||||
return hyperbolic && !bt::in() && !arcm::in() && !kite::in() && !experimental && !hybri && !arb::in() && !quotient;
|
return hyperbolic && !bt::in() && !arcm::in() && !kite::in() && !experimental && !hybri && !arb::in() && !quotient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,7 +1932,6 @@ EX void gen_temple(cell *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX void moreBigStuff(cell *c) {
|
EX void moreBigStuff(cell *c) {
|
||||||
if(currentmap->strict_tree_rules()) return;
|
|
||||||
|
|
||||||
if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot)
|
if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot)
|
||||||
if(have_alt(c)) if(!(bt::in() && specialland != laCamelot))
|
if(have_alt(c)) if(!(bt::in() && specialland != laCamelot))
|
||||||
|
2
cell.cpp
2
cell.cpp
@ -231,6 +231,8 @@ EX hrmap *newAltMap(heptagon *o) {
|
|||||||
if(reg3::in_rule())
|
if(reg3::in_rule())
|
||||||
return reg3::new_alt_map(o);
|
return reg3::new_alt_map(o);
|
||||||
#endif
|
#endif
|
||||||
|
if(currentmap->strict_tree_rules())
|
||||||
|
return rulegen::new_hrmap_rulegen_alt(o);
|
||||||
return new hrmap_hyperbolic(o);
|
return new hrmap_hyperbolic(o);
|
||||||
}
|
}
|
||||||
// --- hyperbolic geometry ---
|
// --- hyperbolic geometry ---
|
||||||
|
@ -99,12 +99,20 @@ template<class T, class U> vector<int> get_children_codes(cell *c, const T& dist
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void expansion_analyzer::preliminary_grouping() {
|
void expansion_analyzer::preliminary_grouping() {
|
||||||
samples.clear();
|
samples.clear();
|
||||||
codeid.clear();
|
codeid.clear();
|
||||||
children.clear();
|
children.clear();
|
||||||
if(reg3::in_rule()) {
|
if(currentmap->strict_tree_rules()) {
|
||||||
|
N = isize(rulegen::treestates);
|
||||||
|
children.resize(N);
|
||||||
|
rootid = rulegen::rule_root;
|
||||||
|
for(int i=0; i<N; i++)
|
||||||
|
for(int v: rulegen::treestates[i].rules)
|
||||||
|
if(v >= 0) children[i].push_back(v);
|
||||||
|
}
|
||||||
|
else if(reg3::in_rule()) {
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
rootid = reg3::rule_get_root(0);
|
rootid = reg3::rule_get_root(0);
|
||||||
auto& chi = reg3::rule_get_children();
|
auto& chi = reg3::rule_get_children();
|
||||||
@ -387,6 +395,8 @@ EX bool sizes_known() {
|
|||||||
// not implemented
|
// not implemented
|
||||||
if(arcm::in()) return false;
|
if(arcm::in()) return false;
|
||||||
if(kite::in()) return false;
|
if(kite::in()) return false;
|
||||||
|
if(currentmap->strict_tree_rules()) return true;
|
||||||
|
if(arb::in()) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,6 +452,8 @@ EX int curr_dist(cell *c) {
|
|||||||
int position;
|
int position;
|
||||||
|
|
||||||
EX int type_in_reduced(expansion_analyzer& ea, cell *c, const cellfunction& f) {
|
EX int type_in_reduced(expansion_analyzer& ea, cell *c, const cellfunction& f) {
|
||||||
|
if(currentmap->strict_tree_rules())
|
||||||
|
return rulegen::get_state(c);
|
||||||
int a = ea.N;
|
int a = ea.N;
|
||||||
int t = type_in(ea, c, f);
|
int t = type_in(ea, c, f);
|
||||||
if(expansion.N != a) {
|
if(expansion.N != a) {
|
||||||
@ -703,7 +715,7 @@ void expansion_analyzer::view_distances_dialog() {
|
|||||||
|
|
||||||
if(really_use_analyzer) {
|
if(really_use_analyzer) {
|
||||||
int t;
|
int t;
|
||||||
if(reg3::in_rule()) {
|
if(reg3::in_rule() || currentmap->strict_tree_rules()) {
|
||||||
if(!N) preliminary_grouping();
|
if(!N) preliminary_grouping();
|
||||||
t = rootid;
|
t = rootid;
|
||||||
}
|
}
|
||||||
@ -743,7 +755,7 @@ void expansion_analyzer::view_distances_dialog() {
|
|||||||
dialog::addBreak(100 * scrolltime / scrollspeed);
|
dialog::addBreak(100 * scrolltime / scrollspeed);
|
||||||
|
|
||||||
if(sizes_known() || bt::in()) {
|
if(sizes_known() || bt::in()) {
|
||||||
if(euclid) {
|
if(euclid && !arb::in()) {
|
||||||
dialog::addBreak(200);
|
dialog::addBreak(200);
|
||||||
dialog::addInfo("a(d) = " + its(get_descendants(10).approx_int() - get_descendants(9).approx_int()) + "d", forecolor);
|
dialog::addInfo("a(d) = " + its(get_descendants(10).approx_int() - get_descendants(9).approx_int()) + "d", forecolor);
|
||||||
}
|
}
|
||||||
|
@ -777,6 +777,7 @@ void geometry_information::generate_floorshapes() {
|
|||||||
for(int i=0; i<n; i++) {
|
for(int i=0; i<n; i++) {
|
||||||
auto &ms = models[i];
|
auto &ms = models[i];
|
||||||
auto &mh = modelh[i];
|
auto &mh = modelh[i];
|
||||||
|
mh.fieldval = -1;
|
||||||
for(auto& t: ms.c.move_table) t = nullptr;
|
for(auto& t: ms.c.move_table) t = nullptr;
|
||||||
for(auto& t: mh.c.move_table) t = nullptr;
|
for(auto& t: mh.c.move_table) t = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -3535,6 +3535,9 @@ EX bool placeSidewall(cell *c, int i, int sidepar, const shiftmatrix& V, color_t
|
|||||||
if(arcm::in() && !PURE)
|
if(arcm::in() && !PURE)
|
||||||
i = gmod(i + arcm::parent_index_of(c->master)/DUALMUL, c->type);
|
i = gmod(i + arcm::parent_index_of(c->master)/DUALMUL, c->type);
|
||||||
#endif
|
#endif
|
||||||
|
if(currentmap->strict_tree_rules()) {
|
||||||
|
i = rulegen::get_arb_dir(c, i);
|
||||||
|
}
|
||||||
draw_shapevec(c, V2, qfi.fshape->gpside[sidepar][i], col, prio);
|
draw_shapevec(c, V2, qfi.fshape->gpside[sidepar][i], col, prio);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "kite.cpp"
|
#include "kite.cpp"
|
||||||
#include "archimedean.cpp"
|
#include "archimedean.cpp"
|
||||||
#include "arbitrile.cpp"
|
#include "arbitrile.cpp"
|
||||||
|
#include "rulegen.cpp"
|
||||||
#include "euclid.cpp"
|
#include "euclid.cpp"
|
||||||
#include "sphere.cpp"
|
#include "sphere.cpp"
|
||||||
#include "fake.cpp"
|
#include "fake.cpp"
|
||||||
|
1568
rulegen.cpp
Normal file
1568
rulegen.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user