Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef AESOP_APPLICATION_H__
00032 #define AESOP_APPLICATION_H__
00033
00034
00035 #include "client-game-logic.h"
00036
00037 #include "aesop-clib/aesop-client.h"
00038 #include "gamepad/gamepad.h"
00039 #include "glut/glut.h"
00040 #include "story/story.h"
00041
00042
00043
00044 class Datahash;
00045
00046
00047 namespace aesop {
00048
00054
00057
00058 struct player_stats_t {
00059
00060 player_stats_t(void) throw() { this->clear(); }
00061 void clear(void) throw() {
00062 haveKeyboard = false;
00063 clientState = eClientState_Invalid;
00064 gamepad = NULL;
00065 server = serverInfo = "";
00066 }
00067
00068
00069 bool haveKeyboard;
00070 eClientState clientState;
00071 smart_ptr<gamepad::Gamepad> gamepad;
00072 std::string server;
00073 std::string serverInfo;
00074 };
00075
00076
00077
00081 class Application : public glut::Host {
00082 public:
00083
00084 virtual ~Application(void) throw();
00085
00086
00087 virtual story::Story * getStory(void) = 0;
00088 virtual bool getPlayerStats(IN int playerId,
00089 OUT player_stats_t& stats) = 0;
00090 virtual void takeKeyboard(IN int playerId) = 0;
00091 virtual void newGame(IN int playerId) = 0;
00092 virtual void addPlayer(void) = 0;
00093 virtual bool dropPlayer(IN int playerId) = 0;
00094 virtual void configureControls(IN int playerId) = 0;
00095 virtual const server_map_t& getServers(void) = 0;
00096 virtual bool requestConnect(IN const char * serverKey) = 0;
00097
00098
00099 static smart_ptr<Application> create(IN const char * config_dir,
00100 IN smart_ptr<Datahash>& params,
00101 IN smart_ptr<ClientGameLogic>& gameLogic,
00102 IN smart_ptr<story::Story>& story);
00103 };
00104
00105
00106 };
00107
00108 #endif // AESOP_APPLICATION_H__
00109