00001 #ifndef HEADER_WORLDMAP_H 00002 #define HEADER_WORLDMAP_H 00003 00004 class Path; 00005 class Level; 00006 class LevelNode; 00007 class NodeDrawer; 00008 class ResDialogPack; 00009 class LevelDesc; 00010 class LevelStatus; 00011 class LayeredPicture; 00012 00013 #include "Drawable.h" 00014 #include "GameState.h" 00015 #include "DescFinder.h" 00016 00017 /** 00018 * Map with path from one level to another. 00019 */ 00020 class WorldMap : public GameState, public DescFinder, public Drawable { 00021 private: 00022 LevelNode *m_startNode; 00023 LevelNode *m_selected; 00024 LevelNode *m_ending; 00025 NodeDrawer *m_drawer; 00026 ResDialogPack *m_descPack; 00027 LevelStatus *m_levelStatus; 00028 00029 LayeredPicture *m_bg; 00030 Uint32 m_activeMask; 00031 Uint32 m_maskIntro; 00032 Uint32 m_maskExit; 00033 Uint32 m_maskCredits; 00034 Uint32 m_maskOptions; 00035 private: 00036 void prepareBg(); 00037 void watchCursor(); 00038 Level *createSelected() const; 00039 void markSolved(); 00040 bool checkEnding() const; 00041 00042 void runIntro(); 00043 void runCredits(); 00044 void runOptions(); 00045 protected: 00046 virtual void own_initState(); 00047 virtual void own_updateState(); 00048 virtual void own_pauseState() {} 00049 virtual void own_resumeState(); 00050 virtual void own_cleanState(); 00051 public: 00052 WorldMap(); 00053 virtual ~WorldMap(); 00054 virtual const char *getName() const { return "state_worldmap"; }; 00055 void initMap(const Path &mapfile); 00056 00057 virtual void drawOn(SDL_Surface *screen); 00058 void runSelected(); 00059 00060 void addDesc(const std::string &codename, LevelDesc *desc); 00061 virtual std::string findLevelName(const std::string &codename) const; 00062 virtual std::string findDesc(const std::string &codename) const; 00063 }; 00064 00065 #endif