| 1 |
#ifndef HEADER_WORLDMAP_H |
| 2 |
#define HEADER_WORLDMAP_H |
| 3 |
|
| 4 |
class Path; |
| 5 |
class Level; |
| 6 |
class LevelNode; |
| 7 |
class NodeDrawer; |
| 8 |
class ResDialogPack; |
| 9 |
class LevelDesc; |
| 10 |
class LevelStatus; |
| 11 |
class LayeredPicture; |
| 12 |
|
| 13 |
#include "Drawable.h" |
| 14 |
#include "GameState.h" |
| 15 |
#include "DescFinder.h" |
| 16 |
#include "V2.h" |
| 17 |
|
| 18 |
/** |
| 19 |
* Map with path from one level to another. |
| 20 |
*/ |
| 21 |
class WorldMap : public GameState, public DescFinder, public Drawable { |
| 22 |
private: |
| 23 |
V2 m_lastMouseLoc; |
| 24 |
LevelNode *m_startNode; |
| 25 |
LevelNode *m_selected; |
| 26 |
LevelNode *m_ending; |
| 27 |
NodeDrawer *m_drawer; |
| 28 |
ResDialogPack *m_descPack; |
| 29 |
LevelStatus *m_levelStatus; |
| 30 |
|
| 31 |
LayeredPicture *m_bg; |
| 32 |
Uint32 m_activeMask; |
| 33 |
Uint32 m_maskIntro; |
| 34 |
Uint32 m_maskExit; |
| 35 |
Uint32 m_maskCredits; |
| 36 |
Uint32 m_maskOptions; |
| 37 |
private: |
| 38 |
void prepareBg(); |
| 39 |
void watchCursor(); |
| 40 |
Level *createSelected() const; |
| 41 |
void markSolved(); |
| 42 |
bool checkEnding() const; |
| 43 |
|
| 44 |
void runIntro(); |
| 45 |
void runCredits(); |
| 46 |
void runOptions(); |
| 47 |
protected: |
| 48 |
virtual void own_initState(); |
| 49 |
virtual void own_updateState(); |
| 50 |
virtual void own_pauseState() {} |
| 51 |
virtual void own_resumeState(); |
| 52 |
virtual void own_cleanState(); |
| 53 |
public: |
| 54 |
WorldMap(); |
| 55 |
virtual ~WorldMap(); |
| 56 |
virtual const char *getName() const { return "state_worldmap"; }; |
| 57 |
void initMap(const Path &mapfile); |
| 58 |
|
| 59 |
virtual void drawOn(SDL_Surface *screen); |
| 60 |
void selectNextLevel(); |
| 61 |
void runSelected(); |
| 62 |
|
| 63 |
void addDesc(const std::string &codename, LevelDesc *desc); |
| 64 |
virtual std::string findLevelName(const std::string &codename) const; |
| 65 |
virtual std::string findDesc(const std::string &codename) const; |
| 66 |
}; |
| 67 |
|
| 68 |
#endif |