3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef CONTENT_SAO_HEADER
21 #define CONTENT_SAO_HEADER
23 #include "serverobject.h"
24 #include "content_object.h"
26 class TestSAO : public ServerActiveObject
29 TestSAO(ServerEnvironment *env, u16 id, v3f pos);
31 {return ACTIVEOBJECT_TYPE_TEST;}
32 static ServerActiveObject* create(ServerEnvironment *env, u16 id, v3f pos,
33 const std::string &data);
34 void step(float dtime, bool send_recommended);
40 class ItemSAO : public ServerActiveObject
43 ItemSAO(ServerEnvironment *env, u16 id, v3f pos,
44 const std::string inventorystring);
46 {return ACTIVEOBJECT_TYPE_ITEM;}
47 static ServerActiveObject* create(ServerEnvironment *env, u16 id, v3f pos,
48 const std::string &data);
49 void step(float dtime, bool send_recommended);
50 std::string getClientInitializationData();
51 std::string getStaticData();
52 InventoryItem* createInventoryItem();
53 InventoryItem* createPickedUpItem(){return createInventoryItem();}
55 std::string m_inventorystring;
57 v3f m_last_sent_position;
58 IntervalLimiter m_move_interval;
61 class RatSAO : public ServerActiveObject
64 RatSAO(ServerEnvironment *env, u16 id, v3f pos);
66 {return ACTIVEOBJECT_TYPE_RAT;}
67 static ServerActiveObject* create(ServerEnvironment *env, u16 id, v3f pos,
68 const std::string &data);
69 void step(float dtime, bool send_recommended);
70 std::string getClientInitializationData();
71 std::string getStaticData();
72 InventoryItem* createPickedUpItem();
75 IntervalLimiter m_inactive_interval;
78 v3f m_last_sent_position;
83 bool m_touching_ground;
86 class Oerkki1SAO : public ServerActiveObject
89 Oerkki1SAO(ServerEnvironment *env, u16 id, v3f pos);
91 {return ACTIVEOBJECT_TYPE_OERKKI1;}
92 static ServerActiveObject* create(ServerEnvironment *env, u16 id, v3f pos,
93 const std::string &data);
94 void step(float dtime, bool send_recommended);
95 std::string getClientInitializationData();
96 std::string getStaticData();
97 InventoryItem* createPickedUpItem(){return NULL;}
98 u16 punch(const std::string &toolname, v3f dir);
100 void doDamage(u16 d);
103 IntervalLimiter m_inactive_interval;
106 v3f m_last_sent_position;
111 bool m_touching_ground;
113 float m_after_jump_timer;