I looked at those nut's there and I have a question. "class Player extends CollisionActor" indicates that players are actual objects and not just abstractions. Wouldn't that make it difficult to change the thing the player controls while in-game (think of hopping in a vehicle or so). This is how my pattern actually goes:
class Controller // Base class of all controllers
{
Actor *m_CurrentControllee;
}
class Actor // Base class of any in-game object
{
Controller *m_CurrentController
}
class AIController : public Controller;
class PlayerController : public Controller;
class NetworkController : public Controller;
And so forth. Things like vehicles (or a hovercraft in the demo) do nothing when not controlled, can be pushed around, shot at, etc... A PlayerController, when not attached to anything is a floating eye, does not interact with the game scene, etc... etc... a FreeCam. When it is attached it then controls the object, sending commands to move, etc... etc... (if the Actor subclass implements the appropriate callbacks). If the PlayerController does not have a viewtarget, then the viewtarget is set to the actor is possesses. When it has a viewtarget, the target itself sets where the view is, can be first person, third person, a follow cam, etc..., can switch in real-time and so forth. But this makes it so that a person is walking around in nice first-person view, can hop into a hovercraft, which sees the previous controllee as a person class and attaches the person to the seat in the vehicle, and the Controller takes over the vehicle, switching view and all. Later on the person can hope back out, thus going back to a person, and so on and so forth. All elegently done and makes it exceedingly easy to make more player controllable objects. The AIController (not really implemented, but it would be like this) changes itself based on the controllee. The controllee can specify an ai script for the thing to use, other variables are based around on things, etc... and so forth. The NetworkController is a proxy to keep things synced with an AI (usually implemented on all clients rather then just one owner) or Player controller across the network to handle command replication, interpolation, etc...