Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_ParentActuator.h
- This file was moved from source/gameengine/Ketsji/KX_ParentActuator.h.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file KX_ParentActuator.h | /** \file SCA_ParentActuator.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| * \brief Set or remove an objects parent | * \brief Set or remove an objects parent | ||||
| */ | */ | ||||
| #ifndef __KX_PARENTACTUATOR_H__ | #ifndef __SCA_PARENTACTUATOR_H__ | ||||
| #define __KX_PARENTACTUATOR_H__ | #define __SCA_PARENTACTUATOR_H__ | ||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| #include "SCA_LogicManager.h" | #include "SCA_LogicManager.h" | ||||
| class KX_ParentActuator : public SCA_IActuator | class SCA_ParentActuator : public SCA_IActuator | ||||
| { | { | ||||
| Py_Header | Py_Header | ||||
| /** Mode */ | /** Mode */ | ||||
| int m_mode; | int m_mode; | ||||
| /** option */ | /** option */ | ||||
| bool m_addToCompound; | bool m_addToCompound; | ||||
| bool m_ghost; | bool m_ghost; | ||||
| /** Object to set as parent */ | /** Object to set as parent */ | ||||
| SCA_IObject *m_ob; | SCA_IObject *m_ob; | ||||
| public: | public: | ||||
| enum KX_PARENTACT_MODE | enum KX_PARENTACT_MODE { | ||||
| { | |||||
| KX_PARENT_NODEF = 0, | KX_PARENT_NODEF = 0, | ||||
| KX_PARENT_SET, | KX_PARENT_SET, | ||||
| KX_PARENT_REMOVE, | KX_PARENT_REMOVE, | ||||
| KX_PARENT_MAX | KX_PARENT_MAX | ||||
| }; | }; | ||||
| KX_ParentActuator(class SCA_IObject* gameobj, | SCA_ParentActuator(class SCA_IObject* gameobj, | ||||
| int mode, | int mode, | ||||
| bool addToCompound, | bool addToCompound, | ||||
| bool ghost, | bool ghost, | ||||
| SCA_IObject *ob); | SCA_IObject *ob); | ||||
| virtual ~KX_ParentActuator(); | virtual ~SCA_ParentActuator(); | ||||
| virtual bool Update(); | virtual bool Update(); | ||||
| virtual CValue* GetReplica(); | virtual CValue* GetReplica(); | ||||
| virtual void ProcessReplica(); | virtual void ProcessReplica(); | ||||
| virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); | virtual void Relink(CTR_Map<CTR_HashedPtr, void*> *obj_map); | ||||
| virtual bool UnlinkObject(SCA_IObject* clientobj); | virtual bool UnlinkObject(SCA_IObject* clientobj); | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| /* --------------------------------------------------------------------- */ | /* --------------------------------------------------------------------- */ | ||||
| /* Python interface ---------------------------------------------------- */ | /* Python interface ---------------------------------------------------- */ | ||||
| /* --------------------------------------------------------------------- */ | /* --------------------------------------------------------------------- */ | ||||
| /* These are used to get and set m_ob */ | /* These are used to get and set m_ob */ | ||||
| static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| #endif /* WITH_PYTHON */ | #endif /* WITH_PYTHON */ | ||||
| }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ | }; /* end of class SCA_ParentActuator : public SCA_PropertyActuator */ | ||||
| #endif /* __KX_PARENTACTUATOR_H__ */ | #endif /* __SCA_PARENTACTUATOR_H__ */ | ||||