summaryrefslogtreecommitdiff
path: root/src/clientobject.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-04-10 04:15:10 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-04-10 04:15:10 +0300
commitfd7a0735c9aeaa7978190049319e3cdfe48920a4 (patch)
tree655709280d2940de54bd489a24821a158cea787d /src/clientobject.h
parentc0f0c6568bb45350e65f31476578feff879831bf (diff)
downloadminetest-fd7a0735c9aeaa7978190049319e3cdfe48920a4.tar.gz
minetest-fd7a0735c9aeaa7978190049319e3cdfe48920a4.tar.bz2
minetest-fd7a0735c9aeaa7978190049319e3cdfe48920a4.zip
new object system
Diffstat (limited to 'src/clientobject.h')
-rw-r--r--src/clientobject.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/clientobject.h b/src/clientobject.h
index ebdcb948e..50fae67c2 100644
--- a/src/clientobject.h
+++ b/src/clientobject.h
@@ -35,6 +35,8 @@ Some planning
*/
+class ClientEnvironment;
+
class ClientActiveObject : public ActiveObject
{
public:
@@ -51,11 +53,13 @@ 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
@@ -66,9 +70,11 @@ public:
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;
};
@@ -112,7 +118,7 @@ public:
v3s16 getLightPosition();
void updateNodePos();
- void step(float dtime);
+ void step(float dtime, ClientEnvironment *env);
void processMessage(const std::string &data);
@@ -144,7 +150,7 @@ public:
v3s16 getLightPosition();
void updateNodePos();
- void step(float dtime);
+ void step(float dtime, ClientEnvironment *env);
void processMessage(const std::string &data);