From 571fb14f9480a0fd70d7cfeb0484c9513153c33a Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 13 Dec 2010 03:19:12 +0200 Subject: working nicely --- src/mapblockobject.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 7 deletions(-) (limited to 'src/mapblockobject.h') diff --git a/src/mapblockobject.h b/src/mapblockobject.h index 2a5f9c933..61bd6610d 100644 --- a/src/mapblockobject.h +++ b/src/mapblockobject.h @@ -28,13 +28,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "constants.h" #include "debug.h" -enum -{ - MAPBLOCKOBJECT_TYPE_TEST=0, - MAPBLOCKOBJECT_TYPE_TEST2=1, - MAPBLOCKOBJECT_TYPE_SIGN=2, - MAPBLOCKOBJECT_TYPE_RAT=3, -}; +#define MAPBLOCKOBJECT_TYPE_TEST 0 +#define MAPBLOCKOBJECT_TYPE_TEST2 1 +#define MAPBLOCKOBJECT_TYPE_SIGN 2 +#define MAPBLOCKOBJECT_TYPE_RAT 3 +// Used for handling selecting special stuff +//#define MAPBLOCKOBJECT_TYPE_PSEUDO 4 class MapBlock; @@ -170,6 +169,57 @@ protected: friend class MapBlockObjectList; }; +#if 0 +/* + Used for handling selections of special stuff +*/ +class PseudoMBObject : public MapBlockObject +{ +public: + // The constructor of every MapBlockObject should be like this + PseudoMBObject(MapBlock *block, s16 id, v3f pos): + MapBlockObject(block, id, pos) + { + } + virtual ~PseudoMBObject() + { + if(m_selection_box) + delete m_selection_box; + } + + /* + Implementation interface + */ + virtual u16 getTypeId() const + { + return MAPBLOCKOBJECT_TYPE_PSEUDO; + } + virtual void serialize(std::ostream &os, u8 version) + { + assert(0); + } + virtual void update(std::istream &is, u8 version) + { + assert(0); + } + virtual bool serverStep(float dtime) + { + assert(0); + } + + /* + Special methods + */ + + void setSelectionBox(core::aabbox3d box) + { + m_selection_box = new core::aabbox3d(box); + } + +protected: +}; +#endif + class TestObject : public MapBlockObject { public: -- cgit v1.2.3