1 /*
2  *
3  *  Iter Vehemens ad Necem (IVAN)
4  *  Copyright (C) Timo Kiviluoto
5  *  Released under the GNU General
6  *  Public License
7  *
8  *  See LICENSING which should be included
9  *  along with this file for more details
10  *
11  */
12 
13 #ifndef __DUNGEON_H__
14 #define __DUNGEON_H__
15 
16 #include "v2.h"
17 
18 class level;
19 class outputfile;
20 class inputfile;
21 class dungeonscript;
22 class levelscript;
23 class festring;
24 
25 class dungeon
26 {
27  public:
28   dungeon() = default;
29   dungeon(int);
30   ~dungeon();
31   truth PrepareLevel(int, truth = true);
32   void SaveLevel(cfestring&, int, truth = true);
33   level* LoadLevel(cfestring&, int);
GetLevel(int I)34   level* GetLevel(int I) const { return Level[I]; }
35   int GetLevels() const;
36   void Save(outputfile&) const;
37   void Load(inputfile&);
SetIndex(int What)38   void SetIndex(int What) { Index = What; }
GetIndex()39   int GetIndex() const { return Index; }
40   const levelscript* GetLevelScript(int);
GetWorldMapPos()41   v2 GetWorldMapPos() { return WorldMapPos; }
SetWorldMapPos(v2 What)42   void SetWorldMapPos(v2 What) { WorldMapPos = What; }
43   festring GetLevelDescription(int,bool bPretty = false);
44   festring GetShortLevelDescription(int);
45   level* LoadLevel(inputfile&, int);
IsGenerated(int I)46   truth IsGenerated(int I) const { return Generated[I]; }
SetIsGenerated(int I,truth What)47   void SetIsGenerated(int I, truth What) { Generated[I] = What; }
48   int GetLevelTeleportDestination(int) const;
49   void PrepareMusic(int);
50  private:
51   void Initialize();
52   const dungeonscript* DungeonScript;
53   level** Level;
54   int Index;
55   truth* Generated;
56   v2 WorldMapPos;
57 };
58 
59 outputfile& operator<<(outputfile&, const dungeon*);
60 inputfile& operator>>(inputfile&, dungeon*&);
61 
62 #endif
63