Discussion Suggestion Unseal CharacterObject or Replace Declarations with BasicCharacterObject

Users who are viewing this thread

So, for my mod it would be really useful if I could make my own subclass of CharacterObject, but unfortunately it's sealed. Right now I'm using a workaround where a separate class has the fields and methods I want to add and I map CharacterObject instances to instances of this class.

I would be happy to just extend BasicCharacterObject, which one would assume is the intended approach given the name and all the virtual properties/methods, but there's one huge problem with that: classes like TroopRosterElement and PartyCharacterVM (to name only a couple) store CharacterObjects, not BasicCharacterObjects. If I made my own BasicCharacterObject subclass, I would not be able to add instances of it to a party's roster, view them in the party screen, have them participate in a tournament, etc.

Simply unsealing the CharacterObject class would be a quick fix that would go a long way, but longer term it would perhaps be best if character objects were always declared as BasicCharacterObject, allowing any subclass to be used. If there are reasons against either of these approaches, I'd love to hear them. Would also like to hear any alternative suggestions and/or general discussion about the nature and relationship of these classes from devs and other modders alike.
 
Back
Top Bottom