*/
+class ClientEnvironment;
+
class ClientActiveObject : public ActiveObject
{
public:
virtual v3f getPosition(){return v3f(0,0,0);}
// Step object in time
- virtual void step(float dtime){}
+ virtual void step(float dtime, ClientEnvironment *env){}
// Process a message sent by the server side object
virtual void processMessage(const std::string &data){}
+ virtual std::string infoText() {return "";}
+
/*
This takes the return value of
ServerActiveObject::getClientInitializationData
static ClientActiveObject* create(u8 type);
protected:
+ // Used for creating objects based on type
typedef ClientActiveObject* (*Factory)();
static void registerType(u16 type, Factory f);
private:
+ // Used for creating objects based on type
static core::map<u16, Factory> m_types;
};
}
};
-/*
- TestCAO
-*/
-
-class TestCAO : public ClientActiveObject
-{
-public:
- TestCAO();
- virtual ~TestCAO();
-
- u8 getType() const
- {
- return ACTIVEOBJECT_TYPE_TEST;
- }
-
- static ClientActiveObject* create();
-
- void addToScene(scene::ISceneManager *smgr);
- void removeFromScene();
- void updateLight(u8 light_at_pos);
- v3s16 getLightPosition();
- void updateNodePos();
-
- void step(float dtime);
-
- void processMessage(const std::string &data);
-
-private:
- scene::IMeshSceneNode *m_node;
- v3f m_position;
-};
-
-/*
- ItemCAO
-*/
-
-class ItemCAO : public ClientActiveObject
-{
-public:
- ItemCAO();
- virtual ~ItemCAO();
-
- u8 getType() const
- {
- return ACTIVEOBJECT_TYPE_ITEM;
- }
-
- static ClientActiveObject* create();
-
- void addToScene(scene::ISceneManager *smgr);
- void removeFromScene();
- void updateLight(u8 light_at_pos);
- v3s16 getLightPosition();
- void updateNodePos();
-
- void step(float dtime);
-
- void processMessage(const std::string &data);
-
- void initialize(const std::string &data);
-
- core::aabbox3d<f32>* getSelectionBox()
- {return &m_selection_box;}
- v3f getPosition()
- {return m_position;}
-
-private:
- core::aabbox3d<f32> m_selection_box;
- scene::IMeshSceneNode *m_node;
- v3f m_position;
- std::string m_inventorystring;
-};
-
#endif