I have now ported over most of the Console functionality from Boom!. I still haven't ported over the ConsoleRenderer yet, so I'll just tackle that tomorrow hopefully. As a little background, Boom! was originally written in 1.1, so I've been pleasantly surprised with how much code I've been able to remove simply because I can use Generics now. The downside? We're not using 2.0 at work yet so it's torture everytime I need a strongly-typed dictionary or list during my day job. I'm starting to realize just how spoiled I might be by being able to choose exactly what technology I want to use on my private projects :).
The current thought that I am having regarding the Console functionality is that I'll implement it using the MVC pattern (Model/View/Controller). The MVC pattern has been floating around at the back of my mind as of late. For the implementation, I'm contemplating introducing a GameContext object which will be the "context" for a GameState. Basically, the GameContext will contain the current Model, View, and Controller that the GameState is working with. Then I'll have the GameState actually have a stack of GameContexts which will enable pushing and popping of contexts. For example, if the user opens the Console a new ConsoleContext will be pushed onto the current GameState. Then when the Console is closed, it will pop itself off of the GameState.
There are some issues I have to work through on this one though: like the fact that I want the GameView to continue to render even if the Console is open (since the Console will only be taking up 1/3rd of the screen). Perhaps it is not the context in which I am pushing and popping, but it is just the GameControllers. If that is the case, there may not even be a need for a GameContext object (as it is just a glorified "wrapper" anyways). Even that idea I'm not entirely comfortable with though as I want to support both a List of GameControllers as well as a Stack. In the case of the Console object, I want to actually push the ConsoleController onto the stack to make sure that _it_ is receiving the current events. However, in the case of two controllers like a PlayerController and a ComputerController (for computer opponents), I want both of them receiving all events at the same time. So, perhaps both a Stack and a List are needed. Or perhaps I can get away with just one if I use an adaptation of a Composition-type pattern? Anyways, there is a lot to think through :).
Well, until then, I'm off to bed and I'll see all y'all on the flip side :). Maybe I'll have those pleasant software design dreams tonight :).