Board Thread:General Discussion/@comment-14966981-20151129065257/@comment-26235098-20151129153302

Flockky's test template uses hardcoded level numbers which in fact wouldn't be used in the general case. I believe(?) he simply did this to illustrate that the logic should be based on level number and not the type parameters. I think(?) that's what he means when he says it needs better coding.

Flockky, coding is possible for this, but I've thought about it before and there are pro's and con's:

PRO: As Rose says, we wouldn't have to add the prev/next level type manually.

CON: Doing this at template level, we'd have to switching on level number - i.e. more than a thousand levels, and done three times. This is VERY inefficient with impact on page loading times, compared to the current processing, and relative ease of manually adding a level type.

Now, there would be a way to do this at module level... but I'm a bit reluctant to move more and more information into modules? However if no-one has a problem with it, I could do it. There would be wrapper templates for editors to use within infoxboxes and pages - users not have to know anything about the module calls.

There may also be other level attributes we want to store in the same way. The volume and granularity of info we have on this wiki is database level at this point. Short of sticking an actual DB under our wiki, using Lua tables for commonly used level properties can make retrieval (and page loading) faster, because Lua accesses the information by index, without repeated value-testing (if, switch) on the whole level list.

(Which reminds me I/we need to complete the work on porting stars... :/ sigh.)

From editor standpoint, doing something like that would be no different as there would be templates to use, just like the difficulty templates. I think though it would have to be done bit by bit.

Your thoughts please???