1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-01 17:32:51 +00:00

rulegen vs extended football

This commit is contained in:
Zeno Rogue 2022-09-14 22:53:39 +02:00
parent 53537271eb
commit 18113f157f
3 changed files with 32 additions and 2 deletions

View File

@ -583,7 +583,7 @@ EX void compute_vertex_valence(arb::arbi_tiling& ac) {
} }
} }
bool extended_football = true; EX bool extended_football = true;
EX void check_football_colorability(arbi_tiling& c) { EX void check_football_colorability(arbi_tiling& c) {
if(cgflags & qAFFINE) return; if(cgflags & qAFFINE) return;
@ -635,7 +635,7 @@ EX void check_football_colorability(arbi_tiling& c) {
} }
} }
if(extended_football) { if(extended_football && !c.have_tree) {
for(auto&sh: c.shapes) for(auto&sh: c.shapes)
sh.football_type = 0; sh.football_type = 0;
@ -1452,6 +1452,7 @@ EX void run(string fname) {
try { try {
load(fname); load(fname);
ginf[gArbitrary].tiling_name = current.name; ginf[gArbitrary].tiling_name = current.name;
tes = fname;
} }
catch(hr_polygon_error& poly) { catch(hr_polygon_error& poly) {
set_geometry(g); set_geometry(g);
@ -1789,6 +1790,8 @@ EX void convert() {
sh.connections.clear(); sh.connections.clear();
sh.cycle_length = id.modval; sh.cycle_length = id.modval;
sh.repeat_value = t / id.modval; sh.repeat_value = t / id.modval;
sh.flags = hr::pseudohept(s) ? arcm::sfPH : 0;
if(arcm::in() && arcm::linespattern(s)) { sh.flags |= arcm::sfLINE; ac.have_line = true; }
for(int j=0; j<t; j++) { for(int j=0; j<t; j++) {
auto co = currentmap->get_corner(s, j); auto co = currentmap->get_corner(s, j);
sh.vertices.push_back(co); sh.vertices.push_back(co);
@ -1829,6 +1832,9 @@ EX void convert() {
} }
arb::compute_vertex_valence(ac); arb::compute_vertex_valence(ac);
ac.have_ph = geosupport_football() ? 1 : 0;
arb::check_football_colorability(ac);
} }
EX bool in() { EX bool in() {

View File

@ -1178,6 +1178,8 @@ EX string cgi_string() {
if(arb::in()) V("AP", its(arb::apeirogon_simplified_display)); if(arb::in()) V("AP", its(arb::apeirogon_simplified_display));
if(arb::in()) V("F", its(arb::extended_football));
if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex)); if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex));
if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step)); if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step));

View File

@ -2584,6 +2584,28 @@ EX void show() {
} }
}); });
dialog::addBoolItem(XLAT("extended football colorability"), arb::extended_football, 'f');
dialog::add_action([] {
arb::extended_football = !arb::extended_football;
rules_known_for = "unknown";
rule_status = "manually disabled";
if(arb::convert::in()) {
stop_game();
arb::convert::convert();
arb::convert::activate();
start_game();
}
else if(arb::in()) {
stop_game();
try {
arb::load(arb::tes);
}
catch(hr_parse_exception& ex) {
println(hlog, "failed: ", ex.s);
}
start_game();
}
});
add_edit(arb::convert::minimize_on_convert); add_edit(arb::convert::minimize_on_convert);
dialog::addBoolItem(XLAT("strict tree based"), currentmap->strict_tree_rules(), 's'); dialog::addBoolItem(XLAT("strict tree based"), currentmap->strict_tree_rules(), 's');
dialog::add_action([] { dialog::add_action([] {