- write "void test({classes.first}<Root>* a, {classes.first}<Root>* b) \{"
- write "\tint x = 0;"
- write "\tfor(int i = 0; i < {loops}; i++) \{"
- write "\t\tfor(int j = 0; j < {loops}; j++) \{"
- write "\t\t\t{classes[middle]}<Root>* to = dynamic_cast<{classes[middle]}<Root>*>(a);"
- write "\t\tif(to != 0) \{ x++; \} else \{ a = b; \}"
+ write "void test({classes.first}<Root>* a, {classes.first}<Root>* b, int loops, int start) \{"
+ write "\tint x = start;"
+ write "\tfor(int i = 0; i < loops; i++) \{"
+ write "\t\tfor(int j = 0; j < loops; j++) \{"
+ var test
+ if dry then test = "" else
+ write "\t\t\t{classes[middle]}<Root>* to = dynamic_cast<{classes[middle]}<Root>*>(a);"
+ test = "to != 0 &&"
+ end
+ write "\t\tif({test}x>=0) \{"
+ if check then write "\t\t\tx += 1"
+ write "\} else \{ x--; a = b;\}"