From ef712a3b4f2be0b96e7cca3572688b473a2cca11 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 11 Jul 2022 16:22:39 +0200 Subject: [PATCH] rulegen:: also number_of_types --- rulegen.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rulegen.cpp b/rulegen.cpp index 26245449..ab964d8c 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -182,6 +182,11 @@ twalker addstep(twalker x) { return x + wstep; } +int number_of_types() { + if(arb::in()) return isize(arb::current.shapes); + throw hr_exception("unknown number_of_types"); + } + int get_id(cell *c) { if(arb::in()) return shvid(c); throw hr_exception("unknown get_id"); @@ -2047,7 +2052,7 @@ EX void generate_rules() { current_getside = first_restart_on; current_examine_branch = first_restart_on; - int NS = isize(arb::current.shapes); + int NS = number_of_types(); shortcuts.resize(NS); analyzers.resize(NS); for(int i=0; i