00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__INCLUDE_LandscapeDefnh_INCLUDE__)
00022 #define __INCLUDE_LandscapeDefnh_INCLUDE__
00023
00024 #include <landscapedef/LandscapeTexDefn.h>
00025 #include <common/fixed.h>
00026 #include <coms/ComsMessage.h>
00027 #include <XML/XMLFile.h>
00028 #include <string>
00029
00030 class LandscapeDefnType
00031 {
00032 public:
00033 enum DefnType
00034 {
00035 eNone,
00036 eStartHeight,
00037 eRoofCavern,
00038 eHeightMapFile,
00039 eHeightMapGenerate
00040 };
00041
00042 virtual bool readXML(XMLNode *node) = 0;
00043 virtual DefnType getType() = 0;
00044 };
00045
00046 class LandscapeDefnTypeNone : public LandscapeDefnType
00047 {
00048 public:
00049 virtual bool readXML(XMLNode *node);
00050 virtual DefnType getType() { return eNone; }
00051 };
00052
00053 class LandscapeDefnStartHeight : public LandscapeDefnType
00054 {
00055 public:
00056 fixed flatness;
00057 fixed startcloseness;
00058 fixed heightmin, heightmax;
00059 std::string startmask;
00060
00061 virtual bool readXML(XMLNode *node);
00062 virtual DefnType getType() { return eStartHeight; }
00063 };
00064
00065 class LandscapeDefnRoofCavern : public LandscapeDefnType
00066 {
00067 public:
00068 LandscapeDefnRoofCavern();
00069 virtual ~LandscapeDefnRoofCavern();
00070
00071 fixed width;
00072 fixed height;
00073 LandscapeDefnType *heightmap;
00074
00075 virtual bool readXML(XMLNode *node);
00076 virtual DefnType getType() { return eRoofCavern; }
00077 };
00078
00079 class LandscapeDefnHeightMapFile : public LandscapeDefnType
00080 {
00081 public:
00082 std::string file;
00083 bool levelsurround;
00084
00085 virtual bool readXML(XMLNode *node);
00086 virtual DefnType getType() { return eHeightMapFile; }
00087 };
00088
00089 class LandscapeDefnHeightMapGenerate : public LandscapeDefnType
00090 {
00091 public:
00092 std::string mask;
00093
00094 fixed noisefactor;
00095 int noisewidth, noiseheight;
00096
00097 int errosions;
00098 int errosionlayering, errosionsurroundsize;
00099 fixed errosionforce, errosionmaxdepth;
00100 fixed errosionsurroundforce;
00101
00102 int landhillsmax, landhillsmin;
00103 fixed landheightmax, landheightmin;
00104 fixed landpeakwidthxmax, landpeakwidthxmin;
00105 fixed landpeakwidthymax, landpeakwidthymin;
00106 fixed landpeakheightmax, landpeakheightmin;
00107 fixed landsmoothing;
00108 bool levelsurround;
00109
00110 virtual bool readXML(XMLNode *node);
00111 virtual DefnType getType() { return eHeightMapGenerate; }
00112 };
00113
00114 class LandscapeDefn
00115 {
00116 public:
00117 LandscapeDefn();
00118 virtual ~LandscapeDefn();
00119
00120 int getMinPlayers() { return minplayers; }
00121 int getMaxPlayers() { return maxplayers; }
00122 int getLandscapeWidth() { return landscapewidth; }
00123 int getLandscapeHeight() { return landscapeheight; }
00124 int getArenaWidth() { return arenawidth; }
00125 int getArenaHeight() { return arenaheight; }
00126 int getArenaX() { return arenax; }
00127 int getArenaY() { return arenay; }
00128
00129 LandscapeDefnType *roof;
00130 LandscapeDefnType *tankstart;
00131 LandscapeDefnType *heightmap;
00132 LandscapeTexDefn texDefn;
00133
00134 bool readXML(LandscapeDefinitions *definitions, XMLNode *node);
00135
00136 protected:
00137 int minplayers, maxplayers;
00138 int landscapewidth, landscapeheight;
00139 int arenawidth, arenaheight;
00140 int arenax, arenay;
00141
00142 private:
00143 LandscapeDefn(const LandscapeDefn &other);
00144 LandscapeDefn &operator=(LandscapeDefn &other);
00145
00146 };
00147
00148 #endif