/********************************************************************** *< FILE: IGameProperty.h DESCRIPTION: IGameProperty interfaces for IGame CREATED BY: Neil Hazzard, Discreet HISTORY: created 02/02/02 IGame Version: 1.122 *> Copyright (c) 2002, All Rights Reserved. **********************************************************************/ #ifndef __IGAMEPROPERTY__H #define __IGAMEPROPERTY__H #pragma once /*!\file IGameProperty.h \brief IParamBlock and IParamBlock2 property access. All properties found by IGame are stored as an IGameProperty. This gives developers a unified way of accessing IParamBlock and IParamBlock2 based properties used in max */ enum PropType{ IGAME_UNKNOWN_PROP, /*!This function is only available in 3ds max 6.0 and above /*! \param &p The Point4 to receive the data \param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame \return TRUE if succesful \sa IGameScene::SetStaticFrame */ virtual bool GetPropertyValue(Point4 &p, TimeValue t=TIME_NegInfinity)=0; //! Access to the actual Parameter Data - /*! \param v The TCHAR to receive the data \param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame \return TRUE if successful \sa IGameScene::SetStaticFrame */ virtual bool GetPropertyValue(TCHAR*& v, TimeValue t=TIME_NegInfinity)=0; }; //!Property Enumeration /*! PropertyEnum allows a developer to define a callback for use with EnumerateProperties. It will be called for every parameter stored in the system */ class PropertyEnum { public: //! The call back function /*! This is called for every property in the system, providing a way of stopping the enumeration if need be \param *prop The actual property found \return TRUE to stop the enumeration */ virtual bool Proc(IGameProperty* prop) = 0; }; //! Property container /*! This class provide an extension mechanism that IGame can use - an Entity is free to use them the idea here, is that a developer can extend the properties that are "known" to IGame this way the property can be retrieved directly by the developer. As it is "known" to the developer the property type is also known and can be accessed directly */ class IPropertyContainer { public: //! Property Access /*!Using the unique ID in the XML file, the property can be queried directly \param PropID The identifier used in the XML file \return A pointer to IGameProperty if found - NULL if not */ virtual IGameProperty * QueryProperty(DWORD PropID) {return NULL;} //! The number of Properties for the Entity /*! \return The number of properties found. The default is 0. This only counts the supported properties as defined in the property file */ virtual int GetNumberOfProperties(){return 0;} //!Direct Property Access /*! The property can be accessed directly from the index provided from the XML file. You can use the IGame Editor to write out the index for the properties as a Header file for easy access. This only works for Supported Parameters, i.e. Properties found in the properties file \param index The index of the property to return \return A pointer to the IGameProperty. The default is NULL */ virtual IGameProperty * GetProperty(int index) {return NULL;} //! Property Access /*!Using the name in the XML file, the property can be queried directly \param propName The name identifier used in the XML file \return A pointer to IGameProperty if found The default is NULL */ virtual IGameProperty * QueryProperty(const TCHAR * propName) {return NULL;} //!Enumerate the Properties /*!All properties can be enumerated by using this method. A user defined callback is used to provide access to the properties. \param &Enum The callback object to use. */ virtual void EnumerateProperties(PropertyEnum & Enum) = 0; }; //!Main property access /*!base Class used by all exporters wanting to take part in the properties system */ class IExportEntity { public: //!Retrieve the Property Container /*! \return The PropertyContainer for this entity. */ virtual IPropertyContainer * GetIPropertyContainer(){return NULL;} //! Is the Entity directly supported /*!IGame provides direct support for certain max object and materials. If the IGameProp.xml file contains additional properties on unknown ClassIDs, for example a new Object then this method is used to find out whether IGame supports them directly. IGame supports the standard material directly, i.e provides direct API calls to get the properties. If a material was found that was not a standard material, then the parameters can be access by using the IGameProp file and the IPropertyContainer file. \return TRUE if IGame supports the parameters for a particular ClassID directly through its API */ virtual bool IsEntitySupported() {return false;} }; #endif