If you like my work, please consider contributing via Patreon.
Obligatory GitHub Link.

I mentioned earlier this “cool thing” I found I could do in Java, where applying an Interface enabled “localized” access to enums stored within the Interface. One of the things I forgot to mention is that makes certain parts of the code more… “compartmentalized,” I guess? How to explain?

Okay, so in striving for code that is concise, easy to maintain, and so forth… I want to make it straightforward to do stuff like… add new races and classes and subclasses and stuff down the line. To an extent that means I need to make sure that basically all the stuff necessary to add a race or class or whatever can be found in one centralized place, so that when it comes time to add them… I only have to touch one object.

Well, counter-intuitive though it may seem, by creating an “Option” Interface to store “Features,” I can have a repository of ALL features, race or class, in one place. The Option Interface can be applied to any object that grants features to give the object access to the repository of features for rapid inclusion, deployment of new feature-granting objects, and so forth.

This is kind of like, really abstract, but consider monster features that duplicate race or class features of characters, or even something straightforward as polymorph. I mean, sometimes you’ll want rapid access to features for a creature or character that normally wouldn’t be allowed. I certainly could segregate each feature type to its own list, but there are so many of them I practically need a library to keep track of them all.

When I eventually get to implementing stuff like feature EFFECTS, it would sure be nice to be one-and-done without necessarily needing to keep track of whether a particular feature is used by characters of Race X, Class Y, and Monster Z. Having them all in one place should make ultimately implementing the effects of said features like, substantially easier.

It’s the same deal with Spell Effects, and I have only the barest framework for that implemented now. I’ll probably end up using something like my previous implementation of the Prototype/Instance structure from Weapons and Armor.

Yet another cool thing about all this though, is it means I should be able to rapidly implement Racial Features by dropping them into the existing framework–and with little or no tweaks to what I have already working in Class Features.