This interface is used by the application to delegate decisions and routing to game-specific logic. More...
#include <client-game-logic.h>
Public Member Functions | |
virtual | ~ClientGameLogic (void) throw () |
virtual void | setHost (IN ClientGameLogicHost *host)=0 |
virtual bool | localPlayerJoined (IN int playerId)=0 |
virtual void | localPlayerLeft (IN int playerId)=0 |
virtual void | notifyInput (IN int playerId, IN const event_t &event)=0 |
virtual void | tick (IN float dt)=0 |
virtual void | appendGameData (IN xdrbuf::Output *outbuf)=0 |
This interface is used by the application to delegate decisions and routing to game-specific logic.
A user of this library must provide an object that implements this interface.
This means that client game logic depends somewhat on client-specific implementation details such as input events! But practically, that is going to be true of any game.
This interface breakdown (Application vs ClientGameLogic) is intended to keep the coupling to a minimum, and to allow people to override the reference game logic and provide their own, without having to change the Application.
Developers needing larger changes (different rendering/input libraries entirely) may want to override behavior at the Application level (or even the aesop::ClientHost interface), in which case they may not need this interface at all.
What does client-side game logic do? After all, a lot of game logic should actually run on the server.
Client-side game logic will:
Definition at line 106 of file glut-app/client-game-logic.h.
aesop::ClientGameLogic::~ClientGameLogic | ( | void | ) | throw () [virtual] |
Definition at line 42 of file application.cpp.
virtual void aesop::ClientGameLogic::setHost | ( | IN ClientGameLogicHost * | host | ) | [pure virtual] |
virtual bool aesop::ClientGameLogic::localPlayerJoined | ( | IN int | playerId | ) | [pure virtual] |
virtual void aesop::ClientGameLogic::localPlayerLeft | ( | IN int | playerId | ) | [pure virtual] |
virtual void aesop::ClientGameLogic::notifyInput | ( | IN int | playerId, | |
IN const event_t & | event | |||
) | [pure virtual] |
virtual void aesop::ClientGameLogic::tick | ( | IN float | dt | ) | [pure virtual] |
virtual void aesop::ClientGameLogic::appendGameData | ( | IN xdrbuf::Output * | outbuf | ) | [pure virtual] |