mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-29 19:40:35 +00:00
an option to change rule_root in the tes file
This commit is contained in:
parent
769411554f
commit
a065e73013
@ -513,6 +513,10 @@ EX void load(const string& fname, bool after_sliding IS(false)) {
|
||||
else if(ep.eat("treestate(")) {
|
||||
rulegen::parse_treestate(c, ep);
|
||||
}
|
||||
else if(ep.eat("first_treestate(")) {
|
||||
rulegen::rule_root = ep.iparse();
|
||||
ep.force_eat(")");
|
||||
}
|
||||
else if(ep.eat("yendor_backsteps(")) {
|
||||
c.yendor_backsteps = ep.iparse();
|
||||
ep.force_eat(")");
|
||||
|
@ -1620,10 +1620,8 @@ EX void parse_treestate(arb::arbi_tiling& c, exp_parser& ep) {
|
||||
}
|
||||
|
||||
EX void verify_parsed_treestates() {
|
||||
println(hlog, arb::current.shapes[0].connections);
|
||||
println(hlog, arb::current.shapes[1].connections);
|
||||
println(hlog, arb::current.shapes[0].stretch_shear);
|
||||
for(auto& ts: treestates) println(hlog, ts.rules);
|
||||
if(rule_root < 0 || rule_root >= isize(treestates))
|
||||
throw hr_parse_exception("undefined treestate as root");
|
||||
for(auto& ts: treestates) for(auto& r: ts.rules) {
|
||||
if(r < 0 && !among(r, DIR_PARENT, DIR_LEFT, DIR_RIGHT))
|
||||
throw hr_parse_exception("negative number in treestates");
|
||||
|
Loading…
Reference in New Issue
Block a user