DavidRieman / WheelMUD

C# Multiple-User Dimension (MUD) framework
56 stars 68 forks source link

Improve composition of Actions to allow for easy overrides #62

Open DavidRieman opened 3 years ago

DavidRieman commented 3 years ago

A pattern emerging with the Renderers and such is to have things be composed with a priority system, such that a game system or custom plugin or a particular admin's customization or the like can be "dropped in" as a replacement for a Core default system, without modifying Core source at all. We should bring this pattern to Actions, to take not just the "most recent" binary with a given action, but to first sort by a Priority number from the exports, so we end up composing (or re-composing at runtime) the most recent of the highest priority version of each named Action. (This should still be compatible with extending new Actions into the system as well.)

@duaneking adds: "This will require interfaces and standardization of the world schema."

DavidRieman commented 3 years ago

There is a Priority attached to these already like [ExportGameAction(100)]; start by testing if adding another Action of the same name with a higher priority (e.g. in the WRM area instead of Core) properly wins precedent and that we do not load/use the lower priority Action.