// EMERGENT GAME TECHNOLOGIES PROPRIETARY INFORMATION // // This software is supplied under the terms of a license agreement or // nondisclosure agreement with Emergent Game Technologies and may not // be copied or disclosed except in accordance with the terms of that // agreement. // // Copyright (c) 1996-2008 Emergent Game Technologies. // All Rights Reserved. // // Emergent Game Technologies, Chapel Hill, North Carolina 27517 // http://www.emergent.net #ifndef NIPREFABCOMPONENT_H #define NIPREFABCOMPONENT_H #include #include #include "NiEntityComponentInterface.h" class NIENTITY_ENTRY NiPrefabComponent : public NiRefObject, public NiEntityComponentInterface { public: // Property names. inline static const NiFixedString& PROP_PREFAB_PATH(); inline static const NiFixedString& PROP_PREFAB_ENTITIES(); NiPrefabComponent(); NiPrefabComponent(const NiFixedString& kPrefabPath); inline const NiFixedString& GetPrefabPath() const; inline void SetPrefabPath(const NiFixedString& kPrefabPath); inline const unsigned int GetPrefabEntityCount() const; inline NiEntityInterface* GetPrefabEntityAt(unsigned int uiIndex) const; inline void AddPrefabEntity(NiEntityInterface* pkEntity); inline void RemovePrefabEntity(NiEntityInterface* pkEntity); inline void RemovePrefabEntityAt(unsigned int uiIndex); inline void RemoveAllPrefabEntities(); // *** begin Emergent internal use only *** static void _SDMInit(); static void _SDMShutdown(); // *** end Emergent internal use only *** protected: // Properties. NiFixedString m_kPrefabPath; NiTPrimitiveArray m_kPrefabEntities; // Class name. static NiFixedString ms_kClassName; // Component name. static NiFixedString ms_kComponentName; // Property names. static NiFixedString ms_kPropPrefabPath; static NiFixedString ms_kPropPrefabEntities; // Property descriptions. static NiFixedString ms_kDescPrefabPath; static NiFixedString ms_kDescPrefabEntities; public: // NiEntityComponentInterface overrides. virtual NiEntityComponentInterface* Clone(bool bInheritProperties); virtual NiEntityComponentInterface* GetMasterComponent() const; virtual void SetMasterComponent( NiEntityComponentInterface* pkMasterComponent); virtual void GetDependentPropertyNames( NiTObjectSet& kDependentPropertyNames); // NiEntityPropertyInterface overrides. virtual void AddReference(); virtual void RemoveReference(); virtual NiFixedString GetClassName() const; virtual NiUniqueID GetTemplateID(); virtual NiBool SetTemplateID(const NiUniqueID& kID); virtual NiFixedString GetName() const; virtual NiBool SetName(const NiFixedString& kName); virtual void Update(NiEntityPropertyInterface* pkParentEntity, float fTime, NiEntityErrorInterface* pkErrors, NiExternalAssetManager* pkAssetManager); virtual void BuildVisibleSet(NiEntityRenderingContext* pkRenderingContext, NiEntityErrorInterface* pkErrors); virtual void GetPropertyNames( NiTObjectSet& kPropertyNames) const; virtual NiBool CanResetProperty(const NiFixedString& kPropertyName, bool& bCanReset) const; virtual NiBool ResetProperty(const NiFixedString& kPropertyName); virtual NiBool MakePropertyUnique(const NiFixedString& kPropertyName, bool& bMadeUnique); virtual NiBool GetDisplayName(const NiFixedString& kPropertyName, NiFixedString& kDisplayName) const; virtual NiBool SetDisplayName(const NiFixedString& kPropertyName, const NiFixedString& kDisplayName); virtual NiBool GetPrimitiveType(const NiFixedString& kPropertyName, NiFixedString& kPrimitiveType) const; virtual NiBool SetPrimitiveType(const NiFixedString& kPropertyName, const NiFixedString& kPrimitiveType); virtual NiBool GetSemanticType(const NiFixedString& kPropertyName, NiFixedString& kSemanticType) const; virtual NiBool SetSemanticType(const NiFixedString& kPropertyName, const NiFixedString& kSemanticType); virtual NiBool GetDescription(const NiFixedString& kPropertyName, NiFixedString& kDescription) const; virtual NiBool SetDescription(const NiFixedString& kPropertyName, const NiFixedString& kDescription); virtual NiBool GetCategory(const NiFixedString& kPropertyName, NiFixedString& kCategory) const; virtual NiBool IsPropertyReadOnly(const NiFixedString& kPropertyName, bool& bIsReadOnly); virtual NiBool IsPropertyUnique(const NiFixedString& kPropertyName, bool& bIsUnique); virtual NiBool IsPropertySerializable(const NiFixedString& kPropertyName, bool& bIsSerializable); virtual NiBool IsPropertyInheritable(const NiFixedString& kPropertyName, bool& bIsInheritable); virtual NiBool IsExternalAssetPath(const NiFixedString& kPropertyName, unsigned int uiIndex, bool& bIsExternalAssetPath) const; virtual NiBool GetElementCount(const NiFixedString& kPropertyName, unsigned int& uiCount) const; virtual NiBool SetElementCount(const NiFixedString& kPropertyName, unsigned int uiCount, bool& bCountSet); virtual NiBool IsCollection(const NiFixedString& kPropertyName, bool& bIsCollection) const; virtual NiBool GetPropertyData(const NiFixedString& kPropertyName, NiFixedString& kData, unsigned int uiIndex = 0) const; virtual NiBool SetPropertyData(const NiFixedString& kPropertyName, const NiFixedString& kData, unsigned int uiIndex = 0); virtual NiBool GetPropertyData(const NiFixedString& kPropertyName, NiEntityInterface*& pkData, unsigned int uiIndex = 0) const; virtual NiBool SetPropertyData(const NiFixedString& kPropertyName, NiEntityInterface* pkData, unsigned int uiIndex = 0); }; #include "NiPrefabComponent.inl" #endif // #ifndef NIPREFABCOMPONENT_H