|
i6engine
1.0
|
Class representing a GameObject in the i6engine. More...
#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/objects/GameObject.h>
Public Member Functions | |
| GameObject () | |
| Constructor for GameObject. Sets the _objGoid with an ID given by GuidServer. The GameObject registers itself in the ObjectController. So deleting the Object shouldn't be necessary. More... | |
| GameObject (const int64_t goid, const core::IPKey &ownerNode, uint64_t uuid, const std::string &tpl, const boost::function< ComPtr(const int64_t, const std::string &, const attributeMap &, const WeakGOPtr &)> &f) | |
| ~GameObject () | |
| Remove all GOCs held by the component table. More... | |
| int64_t | getID () const |
| Returns the GUID of the GameObject. More... | |
| ComPtr | getGOC (uint32_t famID) const |
| Returns a Pointer to the searched GOComponent, if it is in the component table otherwise NULL. More... | |
| ComPtr | getGOC (uint32_t famID, const std::string &identifier) const |
| Returns a Pointer to the searched GOComponent, if it is in the component table otherwise NULL. More... | |
| template<typename T > | |
| utils::sharedPtr< T, api::Component > | getGOC (uint32_t famID) const |
| template<typename T > | |
| utils::sharedPtr< T, api::Component > | getGOC (uint32_t famID, const std::string &identifier) const |
| template<typename T > | |
| utils::sharedPtr< T, api::Component > | getGOC () const |
| template<typename T > | |
| utils::sharedPtr< T, api::Component > | getGOC (const std::string &identifier) const |
| ComPtr | getGOCID (const int64_t id) const |
| Returns a Pointer to the searched GOComponent, if it is in the component table otherwise nullptr. More... | |
| std::vector< ComPtr > | getGOCList () const |
| returns a list of all Components on this GameObject More... | |
| void | setGOC (const ComPtr &objNewGOC) |
| Inserts objNewGOC into the component table. If a GOComponent of the same type already exists, it will be replaced. More... | |
| void | clearGOCs () |
| Remove all GOCs held by the component table. More... | |
| void | setDie () const |
| Sends a message to delete this GameObject on the next Tick of the ObjectController. More... | |
| std::string | getType () const |
| Returns the type of the GameObject. More... | |
| void | setType (const std::string &type) |
| Sets the type of the GameObject. More... | |
| void | deleteGOC (uint32_t famID) |
| Deletes a Component of the Game Object. More... | |
| void | deleteGOC (uint32_t famID, const std::string &identifier) |
| Deletes a Component of the Game Object. More... | |
| void | sendCreateMessage () const |
| void | synchronize (std::vector< GameMessage::Ptr > &messages, bool all) const |
| adds synchronize messages for GameObject and all Components of this GO set param all false if you just want Components with sync flag to be added to message More... | |
| void | sendDeleteMessage () const |
| sends a message to delete the GameObject More... | |
| core::IPKey | getOwner () const |
| returns the owner of this gameObject More... | |
| void | News (const GameMessage::Ptr &msg) |
| processes a message process messages for GameObjects or forwards messages concerning Components [in] msg Message to be processed More... | |
| void | initializeComponents () |
| calls Init for every Component on the GO More... | |
| uint64_t | getUUID () const |
| returns the uuid of this GO More... | |
| void | setSelf (const WeakGOPtr &self) |
| void | setFlags (const std::vector< std::string > &flags) |
| stores the flags for which this GO is visible More... | |
| std::vector< std::string > | getFlags () const |
| void | setSend (bool send) |
| stores whether this object has to be synchronized or not More... | |
| bool | getSend () const |
| template<typename T > | |
| utils::sharedPtr< T, Component > | getGOC (uint32_t famID) const |
| template<typename T > | |
| utils::sharedPtr< T, Component > | getGOC (uint32_t famID, const std::string &identifier) const |
| template<typename T > | |
| utils::sharedPtr< T, Component > | getGOC () const |
| template<typename T > | |
| utils::sharedPtr< T, Component > | getGOC (const std::string &identifier) const |
Class representing a GameObject in the i6engine.
Every GameObject holds a list of Components characterizing this GameObject. These Components also can receive messages as they derive from MessageSubsriber.
component_table_t is an alias for std::map<const goc_id_type, GOComponent*>. component_table_pair_t is an alias for std::pair<const goc_id_type, GOComponent*>.Definition at line 70 of file GameObject.h.
|
inline |
Constructor for GameObject. Sets the _objGoid with an ID given by GuidServer. The GameObject registers itself in the ObjectController. So deleting the Object shouldn't be necessary.
| type | Type of the created object |
Definition at line 77 of file GameObject.h.
| i6e::api::GameObject::GameObject | ( | const int64_t | goid, |
| const core::IPKey & | ownerNode, | ||
| uint64_t | uuid, | ||
| const std::string & | tpl, | ||
| const boost::function< ComPtr(const int64_t, const std::string &, const attributeMap &, const WeakGOPtr &)> & | f | ||
| ) |
| i6e::api::GameObject::~GameObject | ( | ) |
Remove all GOCs held by the component table.
| void i6e::api::GameObject::clearGOCs | ( | ) |
Remove all GOCs held by the component table.
| void i6e::api::GameObject::deleteGOC | ( | uint32_t | famID | ) |
Deletes a Component of the Game Object.
| [in] | famID | FamilyID of the component, which you want to delete |
| void i6e::api::GameObject::deleteGOC | ( | uint32_t | famID, |
| const std::string & | identifier | ||
| ) |
Deletes a Component of the Game Object.
| [in] | famID | FamilyID of the component, which you want to delete |
| [in] | identifier | the string identifier of the special component |
|
inline |
Definition at line 228 of file GameObject.h.
| ComPtr i6e::api::GameObject::getGOC | ( | uint32_t | famID | ) | const |
Returns a Pointer to the searched GOComponent, if it is in the component table otherwise NULL.
| [in] | objFamilyID | of type const goc_id_type& |
| ComPtr i6e::api::GameObject::getGOC | ( | uint32_t | famID, |
| const std::string & | identifier | ||
| ) | const |
Returns a Pointer to the searched GOComponent, if it is in the component table otherwise NULL.
| [in] | objFamilyID | of type const goc_id_type& |
| [in] | identifier | string identifier of the component |
| utils::sharedPtr<T, api::Component> i6e::api::GameObject::getGOC | ( | uint32_t | famID | ) | const |
| utils::sharedPtr<T, api::Component> i6e::api::GameObject::getGOC | ( | uint32_t | famID, |
| const std::string & | identifier | ||
| ) | const |
| utils::sharedPtr<T, api::Component> i6e::api::GameObject::getGOC | ( | ) | const |
| utils::sharedPtr<T, api::Component> i6e::api::GameObject::getGOC | ( | const std::string & | identifier | ) | const |
| utils::sharedPtr<T, Component> i6e::api::GameObject::getGOC | ( | uint32_t | famID | ) | const |
Definition at line 281 of file GameObject.h.
| utils::sharedPtr<T, Component> i6e::api::GameObject::getGOC | ( | uint32_t | famID, |
| const std::string & | identifier | ||
| ) | const |
Definition at line 293 of file GameObject.h.
| utils::sharedPtr<T, Component> i6e::api::GameObject::getGOC | ( | ) | const |
Definition at line 315 of file GameObject.h.
| utils::sharedPtr<T, Component> i6e::api::GameObject::getGOC | ( | const std::string & | identifier | ) | const |
Definition at line 328 of file GameObject.h.
| ComPtr i6e::api::GameObject::getGOCID | ( | const int64_t | id | ) | const |
Returns a Pointer to the searched GOComponent, if it is in the component table otherwise nullptr.
| [in] | objFamilyID | of type const |
| std::vector<ComPtr> i6e::api::GameObject::getGOCList | ( | ) | const |
returns a list of all Components on this GameObject
|
inline |
|
inline |
returns the owner of this gameObject
Definition at line 196 of file GameObject.h.
|
inline |
Definition at line 239 of file GameObject.h.
|
inline |
Returns the type of the GameObject.
Definition at line 157 of file GameObject.h.
|
inline |
returns the uuid of this GO
Definition at line 213 of file GameObject.h.
| void i6e::api::GameObject::initializeComponents | ( | ) |
calls Init for every Component on the GO
| void i6e::api::GameObject::News | ( | const GameMessage::Ptr & | msg | ) |
processes a message process messages for GameObjects or forwards messages concerning Components [in] msg Message to be processed
| void i6e::api::GameObject::sendCreateMessage | ( | ) | const |
| void i6e::api::GameObject::sendDeleteMessage | ( | ) | const |
sends a message to delete the GameObject
| void i6e::api::GameObject::setDie | ( | ) | const |
Sends a message to delete this GameObject on the next Tick of the ObjectController.
|
inline |
stores the flags for which this GO is visible
Definition at line 224 of file GameObject.h.
| void i6e::api::GameObject::setGOC | ( | const ComPtr & | objNewGOC | ) |
Inserts objNewGOC into the component table. If a GOComponent of the same type already exists, it will be replaced.
| [in] | objNewGOC | a GOComponent* argument |
| ISIXE_THROW_FAILURE | when objNewGOC is NULL |
|
inline |
Definition at line 217 of file GameObject.h.
|
inline |
stores whether this object has to be synchronized or not
Definition at line 235 of file GameObject.h.
| void i6e::api::GameObject::setType | ( | const std::string & | type | ) |
Sets the type of the GameObject.
| void i6e::api::GameObject::synchronize | ( | std::vector< GameMessage::Ptr > & | messages, |
| bool | all | ||
| ) | const |
adds synchronize messages for GameObject and all Components of this GO set param all false if you just want Components with sync flag to be added to message