root/cafu/trunk/CaWE/MapEntityBase.hpp

Revision 457, 4.0 KB (checked in by Carsten, 4 months ago)

Using UltraEdit's multi-line search-and-replace-in-files feature, replaced


^#ifndef _(CAFU|CF|CFS|CA)_(.*)_$
^#define _\1_\2_$

with

#ifndef CAFU_\2_INCLUDED
#define CAFU_\2_INCLUDED

and


^#ifndef _(.*)_HPP_$
^#define _\1_HPP_$

with

#ifndef CAFU_\1_HPP_INCLUDED
#define CAFU_\1_HPP_INCLUDED

Closes #91.

Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22#ifndef CAFU_MAP_ENTITY_BASE_HPP_INCLUDED
23#define CAFU_MAP_ENTITY_BASE_HPP_INCLUDED
24
25#include "EntProperty.hpp"
26#include "MapElement.hpp"
27
28
29class EntityClassT;
30class MapPrimitiveT;
31class wxProgressDialog;
32
33
34class MapEntityBaseT : public MapElementT
35{
36    public:
37
38    /// The default constructor.
39    MapEntityBaseT(const wxColour& Color);
40
41    /// The copy constructor for copying a base entity.
42    /// @param Ent   The base entity to copy-construct this base entity from.
43    MapEntityBaseT(const MapEntityBaseT& Ent);
44
45    /// The destructor.
46    ~MapEntityBaseT();
47
48    // Implementations and overrides for base class methods.
49 // MapEntityBaseT* Clone() const;
50    void            Assign(const MapElementT* Elem);
51
52    void Load_cmap   (TextParserT& TP, MapDocumentT& MapDoc, wxProgressDialog* ProgressDialog, unsigned long EntityNr);
53    void Load_HL1_map(TextParserT& TP, MapDocumentT& MapDoc, wxProgressDialog* ProgressDialog, unsigned long EntityNr);
54    void Load_HL2_vmf(TextParserT& TP, MapDocumentT& MapDoc, wxProgressDialog* ProgressDialog, unsigned long EntityNr);
55    void Load_D3_map (TextParserT& TP, MapDocumentT& MapDoc, wxProgressDialog* ProgressDialog, unsigned long EntityNr);
56    void Save_cmap(const MapDocumentT& MapDoc, std::ostream& OutFile, unsigned long EntityNr, const BoundingBox3fT* Intersecting) const;
57
58
59    virtual void SetClass(const EntityClassT* NewClass);
60    const EntityClassT* GetClass() const { return m_Class; }
61
62    const ArrayT<EntPropertyT>& GetProperties() const { return m_Properties; }
63          ArrayT<EntPropertyT>& GetProperties()       { return m_Properties; }
64
65    EntPropertyT*       FindProperty     (const wxString& Key, int* Index=NULL, bool Create=false); ///< Find the property.
66    const EntPropertyT* FindProperty     (const wxString& Key, int* Index=NULL) const;              ///< Find the property.
67    int                 FindPropertyIndex(const wxString& Key) const;                               ///< Get the index of the property.
68
69    virtual void               SetAngles(const cf::math::AnglesfT& Angles);
70    virtual cf::math::AnglesfT GetAngles() const;
71
72    const ArrayT<MapPrimitiveT*>& GetPrimitives() const { return m_Primitives; }
73
74    void AddPrim(MapPrimitiveT* Prim);
75    void RemovePrim(MapPrimitiveT* Prim);
76
77
78    // The TypeSys related declarations for this class.
79    virtual const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
80    static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
81    static const cf::TypeSys::TypeInfoT TypeInfo;
82
83
84    protected:
85
86    const EntityClassT*    m_Class;         ///< The "entity class" of this entity.
87    ArrayT<EntPropertyT>   m_Properties;    ///< The concrete, instantiated properties for this entity, according to its entity class.
88    ArrayT<MapPrimitiveT*> m_Primitives;    ///< The primitive, atomic elements of this entity (brushes, patches, terrains, models, plants, ...).
89};
90
91#endif
Note: See TracBrowser for help on using the browser.