Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

gameadapter.h

00001 /***************************************************************************
00002                           gameadapter.h  -  description
00003                              -------------------
00004     begin                : Sat May 3 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.com
00007 ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef GAME_ADAPTER_H
00019 #define GAME_ADAPTER_H
00020 
00021 #include "constants.h"
00022 #include "userconfiguration.h"
00023 #include "shapepalette.h"
00024 //#include "map.h"
00025 
00026 class Party;
00027 class Map;
00028 class Projectile;
00029 class Creature;
00030 class Session;
00031 class Mission;
00032 class Battle;
00033 class Shape;
00034 class Location;
00035 class Item;
00036 
00037 class GameAdapter {
00038 protected:
00039   UserConfiguration *userConfiguration;
00040   Session *session;
00041 
00042 public:
00043   GameAdapter(UserConfiguration *config);
00044   virtual ~GameAdapter();
00045 
00046   inline UserConfiguration *getUserConfiguration() { return userConfiguration; }
00047 
00048   inline void setSession(Session *session) { this->session = session; }
00049   inline Session *getSession() { return session; }
00050 
00051   virtual inline void initVideo(ShapePalette *shapePal) {}
00052   virtual inline void initUI() {}
00053   virtual inline void start() {}
00054   virtual inline int getScreenWidth() { return 0; }
00055   virtual inline int getScreenHeight() { return 0; }
00056   virtual inline void fightProjectileHitTurn(Projectile *proj, Creature *creature) {}
00057   virtual inline void fightProjectileHitTurn(Projectile *proj, int x, int y) {}
00058   virtual inline void resetPartyUI() {}
00059   virtual inline void refreshInventoryUI(int playerIndex) {}
00060   virtual inline void refreshInventoryUI() {}
00061   virtual inline void toggleRoundUI(bool startRound) {}
00062   virtual inline void setFormationUI(int formation, bool playerOnly) {}
00063   virtual inline void togglePlayerOnlyUI(bool playerOnly) {}
00064   virtual inline void setPlayerUI(int index) {}
00065   virtual inline void updateBoardUI(int count, const char **missionText, Color *missionColor) {}
00066   virtual inline void setMissionDescriptionUI(char *s) {}
00067   virtual inline void missionCompleted() {}
00068   virtual inline void cancelBattle(Creature *creature) {}
00069   virtual inline void moveMonster(Creature *monster) {}
00070   virtual inline void removeBattle(Battle *battle) {}
00071   virtual inline void colorMiniMapPoint(int x, int y, Shape *shape, Location *pos=NULL) {}
00072   virtual inline void eraseMiniMapPoint(int x, int y) {}
00073   virtual inline void playSound(const char *sound) {}
00074   virtual inline void loadMonsterSounds( char *type, map<int, vector<string>*> *soundMap ) {}
00075   virtual inline void unloadMonsterSounds( char *type, map<int, vector<string>*> *soundMap ) {}
00076   virtual inline void setDebugStr(char *s) {}
00077   virtual inline void showItemInfoUI(Item *item, int level) {}
00078   virtual inline double getFps() { return 0.0f; }
00079   virtual inline void createParty( Creature **pc, int *partySize ) {}
00080   virtual inline void setBlendFunc() {}
00081   virtual inline void teleport( bool toHQ=true ) {}
00082   virtual inline int getCurrentDepth() { return 0; }
00083 
00084   // initialization events
00085   virtual inline void initStart(int statusCount, char *message) { cerr << message << endl; }
00086   virtual inline void initUpdate(char *message) { cerr << message << endl; }
00087   virtual inline void initEnd() { }
00088 
00089   virtual inline bool isHeadless() { return true; }
00090 };
00091 
00092 class ServerAdapter : public GameAdapter {
00093 public:
00094   ServerAdapter(UserConfiguration *config);
00095   virtual ~ServerAdapter();
00096   void start();
00097 };
00098 
00099 class ClientAdapter : public GameAdapter {
00100 public:
00101   ClientAdapter(UserConfiguration *config);
00102   virtual ~ClientAdapter();
00103   void start();
00104 };
00105 
00106 #endif
00107 

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0