From 4b54b291ae2ba5a5f214cadad74f0bed29376f84 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 8 Apr 2011 00:47:14 +0300 Subject: Some progress on transitioning from MapBlockObject to ActiveObject. --- src/serverobject.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/serverobject.h') diff --git a/src/serverobject.h b/src/serverobject.h index 1d1888580..241458193 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -87,10 +87,12 @@ public: // Number of players which know about this object u16 m_known_by_count; /* - Whether this object is to be removed when nobody knows about - it anymore. - Removal is delayed to preserve the id for the time during which - it could be confused to some other object by some client. + - Whether this object is to be removed when nobody knows about + it anymore. + - Removal is delayed to preserve the id for the time during which + it could be confused to some other object by some client. + - This is set to true by the step() method when the object wants + to be deleted. */ bool m_removed; @@ -113,5 +115,20 @@ private: float m_age; }; +class ItemSAO : public ServerActiveObject +{ +public: + ItemSAO(ServerEnvironment *env, u16 id, v3f pos, + const std::string inventorystring); + u8 getType() const + { + return ACTIVEOBJECT_TYPE_ITEM; + } + void step(float dtime, Queue &messages); + std::string getClientInitializationData(); +private: + std::string m_inventorystring; +}; + #endif -- cgit v1.2.3