Closed jimkberry closed 2 years ago
Approach will be:
Get rid of IFrontendModeHelper.DispatchCmd() altogether. The interface will only have StartMode and EndMode.
StartMode(modeId) will return a reference to a mode-specific subclass which the mode can talk to directly to do the things it wants to do.
Poof! Simple.
Or.. get rid of IFrontendModeHelper
completely. Leave StartMode()
and EndMode()
in IBeamFrontend
but use them to have the FE code subscribe/unsubscribe to events that a particular mode publishes and invokes.
Not completely sure which approach I prefer. The 2nd is simpler, but the first seems more cross-language ( C# events sometimes seem kinda "magic" and C#-specific)
Going with the events. Turns out there really aren't very many that come from GameMode code
Currently
I<App>Frontend
defines the way the application code talks to the frontend (CLI/Unity, at the moment) It's the responsibility of each platform to have a suitable frontend class that implements the interface.For the most part it's a pretty straightforward API, but it gets a little tricky when there are AppMode-specific things that various AppMode's want to tell the frontend to do.
As it stands, there an
IFrontEndModeHelper
interface which.. well - it's kinda messy. Needs to be simplified because: