i6engine  1.0
ComponentConfig.h
Go to the documentation of this file.
1 /*
2  * i6engine
3  * Copyright (2016) Daniel Bonrath, Michael Baer, All rights reserved.
4  *
5  * This file is part of i6engine; i6engine is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __I6ENGINE_API_COMPONENTCONFIG_H__
26 #define __I6ENGINE_API_COMPONENTCONFIG_H__
27 
29 
32 
33 #include "boost/function.hpp"
34 
35 namespace i6e {
36 namespace api {
37 
38  class Component;
39 
40  typedef utils::sharedPtr<Component, Component> ComPtr;
41 
42  enum ShatterInterest : uint16_t;
43 
44 namespace components {
46  ComReset = 0,
54  };
91  };
92 
97  std::string tpl;
101  Component_Create_Create(const int64_t goid, const int64_t coid, const core::IPKey & r, const std::string & t, const attributeMap & p);
102  template<class Archive>
103  void serialize(Archive & ar, const unsigned int) {
104  ar & boost::serialization::base_object<GameMessageStruct>(*this);
105  ar & tpl;
106  ar & params;
107  }
110 
116  std::string tpl;
119  boost::function<void(ComPtr)> callback;
120  Component_CreateCallback_Create(const int64_t goid, const int64_t coid, const core::IPKey & r, const std::string & t, const attributeMap & p, const boost::function<void(ComPtr)> & cb);
122  return new Component_CreateCallback_Create(*this);
123  }
125 
130  uint32_t famID;
132  Component_Create_Delete(const int64_t goid, const int64_t coid, uint32_t fam);
133  template<class Archive>
134  void serialize(Archive & ar, const unsigned int) {
135  ar & boost::serialization::base_object<GameMessageStruct>(*this);
136  ar & famID;
137  }
140 
146  Component_Spawnpoint_Update(const int64_t goid, const int64_t coid);
147  template<class Archive>
148  void serialize(Archive & ar, const unsigned int) {
149  ar & boost::serialization::base_object<GameMessageStruct>(*this);
150  }
151  Component_Spawnpoint_Update * copy() { return new Component_Spawnpoint_Update(*this); }
153 
158  int64_t other;
161  Component_Shatter_Update(const int64_t goid, const int64_t coid, const int64_t o, ShatterInterest si);
162  template<class Archive>
163  void serialize(Archive & ar, const unsigned int) {
164  ar & boost::serialization::base_object<GameMessageStruct>(*this);
165  ar & other;
166  ar & shatterInterest;
167  }
170 
175  std::map<std::string, std::string> attMap;
177  Component_MoverResync_Update(const int64_t goid, const int64_t coid, std::map<std::string, std::string> am);
178  template<class Archive>
179  void serialize(Archive & ar, const unsigned int) {
180  ar & boost::serialization::base_object<GameMessageStruct>(*this);
181  ar & attMap;
182  }
185 
191  Component_EnableTicking_Update(const int64_t goid, const int64_t coid, bool at);
193  return new Component_EnableTicking_Update(*this);
194  }
196 
197 } /* namespace components */
198 } /* namespace api */
199 } /* namespace i6e */
200 
201 BOOST_CLASS_EXPORT_KEY(i6e::api::components::Component_Create_Create)
202 BOOST_CLASS_EXPORT_KEY(i6e::api::components::Component_Create_Delete)
203 BOOST_CLASS_EXPORT_KEY(i6e::api::components::Component_Spawnpoint_Update)
204 BOOST_CLASS_EXPORT_KEY(i6e::api::components::Component_Shatter_Update)
205 BOOST_CLASS_EXPORT_KEY(i6e::api::components::Component_MoverResync_Update)
206 
207 #endif /* __I6ENGINE_API_COMPONENTCONFIG_H__ */
208 
Indicates, that the Object shattered.
i6e::api::components::Component_Spawnpoint_Update Component_Spawnpoint_Update
reactivates a Spawnpoint
std::map< std::string, std::string > attMap
i6e::api::components::Component_CreateCallback_Create Component_CreateCallback_Create
creates a Component on Object with id goid and Component id coid with registered template name tpl an...
Component_CreateCallback_Create * copy()
Copy method returning an exact copy of itself.
void serialize(Archive &ar, const unsigned int)
deletes Component with familyID famID on GameObject with id goid
#define ISIXE_MODULES_API
i6e::api::components::Component_Shatter_Update Component_Shatter_Update
calls shatter method of given object with id of the other object detected during collision ...
Enables or disables ticking of a Component.
i6e::api::components::Component_Create_Create Component_Create_Create
creates a Component on Object with id goid and Component id coid with registered template name tpl an...
Component_Shatter_Update * copy()
Copy method returning an exact copy of itself.
std::map< std::string, std::string > attributeMap
Definition: attributeMap.h:42
void serialize(Archive &ar, const unsigned int)
void serialize(Archive &ar, const unsigned int)
Creates a new Component and calls callback afterwards.
ShatterInterest
Different flags for collision interest.
Component_MoverResync_Update * copy()
Copy method returning an exact copy of itself.
calls shatter method of given object with id of the other object detected during collision ...
Component_Create_Create * copy()
Copy method returning an exact copy of itself.
Mover Component needs to be resynced.
creates a Component on Object with id goid and Component id coid with registered template name tpl an...
void serialize(Archive &ar, const unsigned int)
Component_Create_Delete * copy()
Copy method returning an exact copy of itself.
i6e::api::components::Component_Create_Delete Component_Create_Delete
deletes Component with familyID famID on GameObject with id goid
i6e::api::components::Component_MoverResync_Update Component_MoverResync_Update
used to resynchronize MoverComponents
Component_EnableTicking_Update(const int64_t goid, const int64_t coid, bool at)
used to resynchronize MoverComponents
Component_Spawnpoint_Update * copy()
Copy method returning an exact copy of itself.
creates a Component on Object with id goid and Component id coid with registered template name tpl an...
utils::sharedPtr< Component, Component > ComPtr
Definition: Component.h:52
Component_EnableTicking_Update * copy()
Copy method returning an exact copy of itself.
enables or disables ticking of a Component
i6e::api::components::Component_EnableTicking_Update Component_EnableTicking_Update
enables or disables ticking of a Component
Reactivates a spawnpoint.
void serialize(Archive &ar, const unsigned int)