Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

things.hpp

Go to the documentation of this file.
00001 // libdoomwad: manipulates Doom wad files.
00002 // Copyright (C) 2005  John Gaughan
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 //
00018 // This library is distributed with the full text of the LGPL. Please see
00019 // the accompanying file named COPYING.
00020 // 
00021 // You may contact the author at john@johngaughan.net
00022 
00046 // C++ required.
00047 #if !defined __cplusplus
00048 #error C++ compiler required
00049 #endif
00050 
00051 // Include guard
00052 #if !defined THINGS_H
00053 #define THINGS_H
00054 
00055 // C++ headers
00056 #include <string>
00057 #include <vector>
00058 
00059 // Doom headers
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

Generated on Fri Jun 10 19:38:51 2005 for libdoomwad by  doxygen 1.4.0