00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00046
00047 #if !defined __cplusplus
00048 #error C++ compiler required
00049 #endif
00050
00051
00052 #if !defined THINGS_H
00053 #define THINGS_H
00054
00055
00056 #include <string>
00057 #include <vector>
00058
00059
00060 #include "global.hpp"
00061 #include "lump.hpp"
00062 #include "wadentry.hpp"
00063
00064 namespace Doomwad
00065 {
00066
00077 EXPORT class Thing : public WadEntryElement
00078 {
00079 public:
00080
00082 static const size_t LENGTH;
00083
00084 static const uint16 EAST;
00085 static const uint16 NORTHEAST;
00086 static const uint16 NORTH;
00087 static const uint16 NORTHWEST;
00088 static const uint16 WEST;
00089 static const uint16 SOUTHWEST;
00090 static const uint16 SOUTH;
00091 static const uint16 SOUTHEAST;
00092
00093 static const uint16 SKILL1;
00094 static const uint16 SKILL2;
00095 static const uint16 SKILL3;
00096 static const uint16 DEAF;
00097 static const uint16 MULTI;
00098 static const uint16 BOOM_NODM;
00099 static const uint16 BOOM_NOCO;
00100 static const uint16 MBF_FRIENDLY;
00101
00102 int16 x;
00103 int16 y;
00104 uint16 angle;
00105 uint16 type;
00106 uint16 flags;
00107
00108 Thing (int16 = 0, int16 = 0, uint16 = EAST, uint16 = 0, uint16 = 0) throw ();
00109 virtual ~Thing (void) throw ();
00110
00111 virtual size_t getLength (void) const throw ();
00112 virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00113 virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00114 virtual std::string toString (void) const throw ();
00115 };
00116
00125 EXPORT class HexenThing : public Thing
00126 {
00127 public:
00128
00130 static const size_t LENGTH;
00131
00132 static const uint16 IN_SP;
00133 static const uint16 IN_COOP;
00134 static const uint16 IN_DM;
00135 static const uint16 TRANSLUCENT;
00136 static const uint16 INVISIBLE;
00137 static const uint16 FRIENDLY;
00138 static const uint16 STANDSTILL;
00139
00140 uint16 id;
00141 int16 x;
00142 int16 y;
00143 int16 height;
00144 uint16 angle;
00145 uint16 type;
00146 uint16 flags;
00147 byte special;
00148 byte arg1;
00149 byte arg2;
00150 byte arg3;
00151 byte arg4;
00152 byte arg5;
00153
00154 HexenThing (uint16 = 0, int16 = 0, int16 = 0, int16 = 0, uint16 = EAST, uint16 = 0, uint16 = 0, byte = 0, byte = 0, byte = 0, byte = 0, byte = 0, byte = 0) throw ();
00155 virtual ~HexenThing (void) throw ();
00156
00157 virtual size_t getLength (void) const throw ();
00158 virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00159 virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00160 virtual std::string toString (void) const throw ();
00161 };
00162
00168 EXPORT class Things : public WadEntry, public std::vector<Thing>
00169 {
00170 public:
00171
00173 static const std::string NAME;
00174
00175 Things (void) throw ();
00176 Things (const Lump&) throw ();
00177 virtual ~Things (void) throw ();
00178
00179 virtual bool setFromLump (const Lump &lump) throw ();
00180 virtual Lump toLump (void) const throw ();
00181 virtual std::string toString (void) const throw ();
00182 };
00183
00189 EXPORT class HexenThings : public WadEntry, public std::vector<HexenThing>
00190 {
00191 public:
00192
00194 static const std::string NAME;
00195
00196 HexenThings (void) throw ();
00197 HexenThings (const Lump&) throw ();
00198 virtual ~HexenThings (void) throw ();
00199
00200 virtual bool setFromLump (const Lump &lump) throw ();
00201 virtual Lump toLump (void) const throw ();
00202 virtual std::string toString (void) const throw ();
00203 };
00204 }
00205 #endif