save and bone files now can be compressed with ZLib (wow!)
[k8-i-v-a-n.git] / src / game / area.h
blob5e46ba1b6cb3185c8ff302e8c6611f55bf1890fe
1 /*
3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
6 * Public License
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __AREA_H__
13 #define __AREA_H__
15 #include <map>
17 #include "rect.h"
20 class character;
21 class square;
22 class bitmap;
23 class outputfile;
24 class inputfile;
27 class area {
28 public:
29 area ();
30 area (int, int);
31 virtual ~area ();
32 virtual void Draw (truth) const = 0;
33 void Save (outputfile &) const;
34 void Load (inputfile &);
35 int GetFlag (v2 Pos) const { return FlagMap[Pos.X][Pos.Y]; }
36 void AddFlag (v2 Pos, int What) { FlagMap[Pos.X][Pos.Y] |= What; }
37 square *GetSquare (v2 Pos) const { return Map[Pos.X][Pos.Y]; }
38 square *GetSquare (int x, int y) const { return Map[x][y]; }
39 int GetXSize () const { return XSize; }
40 int GetYSize () const { return YSize; }
41 void SendNewDrawRequest ();
42 void Initialize (int, int);
43 square *GetNeighbourSquare (v2, int) const;
44 truth IsValidPos (v2 Pos) const { return Pos.X >= 0 && Pos.Y >= 0 && Pos.X < XSize && Pos.Y < YSize; }
45 truth IsValidPos (int X, int Y) const { return X >= 0 && Y >= 0 && X < XSize && Y < YSize; }
46 const rect &GetBorder () const { return Border; }
47 void SetEntryPos (int, v2);
49 protected:
50 square ***Map;
51 uChar **FlagMap;
52 int XSize, YSize;
53 feuLong XSizeTimesYSize;
54 rect Border;
55 std::map<int, v2> EntryMap;
59 #endif