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

sectors.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 
00043 // C++ required.
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047 
00048 // Include guard
00049 #if !defined SECTORS_H
00050 #define SECTORS_H
00051 
00052 // C++ headers
00053 #include <string>
00054 #include <vector>
00055 
00056 // Doom headers
00057 #include "global.hpp"
00058 #include "lump.hpp"
00059 #include "wadentry.hpp"
00060 
00061 namespace Doomwad
00062 {
00063 
00080   EXPORT class Sector : public WadEntryElement
00081   {
00082     public:
00083 
00085     static const size_t LENGTH;
00086 
00089     static const std::string NOFLAT; 
00090 
00092     static const uint16 NORMAL;
00093 
00094     static const uint16 LIGHT_RANDOM;          
00095     static const uint16 LIGHT_BLINK_HALF;      
00096     static const uint16 LIGHT_BLINK_SEC;       
00097     static const uint16 LIGHT_BLINK_DAMAGE;    
00098     static const uint16 LIGHT_OSCILLATE;       
00099     static const uint16 LIGHT_BLINK_HALF_SYNC; 
00100     static const uint16 LIGHT_BLINK_SEC_SYNC;  
00101     static const uint16 LIGHT_FLICKER;         
00102 
00103     static const uint16 DAMAGE_5;        
00104     static const uint16 DAMAGE_10;       
00105     static const uint16 DAMAGE_20;       
00106     static const uint16 SECRET;          
00107     static const uint16 FRICTION;        
00108     static const uint16 WIND;            
00109     static const uint16 NO_SOUND;        
00110     static const uint16 NO_MOTION_SOUND; 
00111 
00112     static const uint16 INVALID;          
00113     static const uint16 GENERALIZED_MASK; 
00114 
00115     // Attributes
00116     int16 z_floor;          
00117     int16 z_ceil;           
00118     std::string flat_floor; 
00119     std::string flat_ceil;  
00120     uint16 light;           
00121     uint16 type;            
00122     uint16 tag;             
00123 
00124     // Constructors
00125     Sector (int16 = 0, int16 = 0, const std::string& = NOFLAT, const std::string& = NOFLAT, uint16 = 0, uint16 = 0, uint16 = 0) throw ();
00126     virtual ~Sector (void) throw ();
00127 
00128     virtual size_t getLength (void) const throw ();
00129     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00130     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00131     virtual std::string toString (void) const throw ();
00132 
00133     static uint16 makeGeneralized (uint16) throw ();
00134   };
00135 
00145   EXPORT class Sectors : public WadEntry, public std::vector<Sector>
00146   {
00147     public:
00148 
00150     static const std::string NAME;
00151 
00152     Sectors (void) throw ();
00153     Sectors (const Lump&) throw ();
00154     virtual ~Sectors (void) throw ();
00155 
00156     virtual bool setFromLump (const Lump &lump) throw ();
00157     virtual Lump toLump (void) const throw ();
00158     virtual std::string toString (void) const throw ();
00159   };
00160 }
00161 #endif

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