|
@@ -64,11 +64,6 @@ class TamlCustomNodeField : public IFactoryObjectReset
|
|
public:
|
|
public:
|
|
TamlCustomNodeField()
|
|
TamlCustomNodeField()
|
|
{
|
|
{
|
|
- // Reset field object.
|
|
|
|
- // NOTE: This MUST be done before the state is reset otherwise we'll be touching uninitialized stuff.
|
|
|
|
- mpFieldWriteNode = NULL;
|
|
|
|
- mpFieldObject = NULL;
|
|
|
|
-
|
|
|
|
resetState();
|
|
resetState();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -80,14 +75,14 @@ public:
|
|
// pretty much anything or everything could be invalid!
|
|
// pretty much anything or everything could be invalid!
|
|
}
|
|
}
|
|
|
|
|
|
- virtual void resetState( void );
|
|
|
|
|
|
+ virtual void resetState( void )
|
|
|
|
+ {
|
|
|
|
+ mFieldName = StringTable->EmptyString;
|
|
|
|
+ *mFieldValue = 0;
|
|
|
|
+ }
|
|
|
|
|
|
void set( const char* pFieldName, const char* pFieldValue );
|
|
void set( const char* pFieldName, const char* pFieldValue );
|
|
|
|
|
|
- void set( const char* pFieldName, SimObject* pFieldObject );
|
|
|
|
-
|
|
|
|
- void setWriteNode( TamlWriteNode* pWriteNode );
|
|
|
|
-
|
|
|
|
inline void getFieldValue( ColorF& fieldValue ) const
|
|
inline void getFieldValue( ColorF& fieldValue ) const
|
|
{
|
|
{
|
|
fieldValue.set( 1.0f, 1.0f, 1.0f, 1.0f );
|
|
fieldValue.set( 1.0f, 1.0f, 1.0f, 1.0f );
|
|
@@ -158,12 +153,6 @@ public:
|
|
return mFieldValue;
|
|
return mFieldValue;
|
|
}
|
|
}
|
|
|
|
|
|
- SimObject* getFieldObject( void ) const;
|
|
|
|
-
|
|
|
|
- inline const TamlWriteNode* getWriteNode( void ) const { return mpFieldWriteNode; }
|
|
|
|
-
|
|
|
|
- bool isObjectField( void ) const;
|
|
|
|
-
|
|
|
|
inline StringTableEntry getFieldName( void ) const { return mFieldName; }
|
|
inline StringTableEntry getFieldName( void ) const { return mFieldName; }
|
|
|
|
|
|
bool fieldNameBeginsWith( const char* pComparison )
|
|
bool fieldNameBeginsWith( const char* pComparison )
|
|
@@ -191,8 +180,6 @@ public:
|
|
private:
|
|
private:
|
|
StringTableEntry mFieldName;
|
|
StringTableEntry mFieldName;
|
|
char mFieldValue[MAX_TAML_NODE_FIELDVALUE_LENGTH];
|
|
char mFieldValue[MAX_TAML_NODE_FIELDVALUE_LENGTH];
|
|
- SimObject* mpFieldObject;
|
|
|
|
- TamlWriteNode* mpFieldWriteNode;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
static FactoryCache<TamlCustomNodeField> TamlCustomNodeFieldFactory;
|
|
static FactoryCache<TamlCustomNodeField> TamlCustomNodeFieldFactory;
|
|
@@ -205,6 +192,11 @@ class TamlCustomNode : public IFactoryObjectReset
|
|
public:
|
|
public:
|
|
TamlCustomNode()
|
|
TamlCustomNode()
|
|
{
|
|
{
|
|
|
|
+ // Reset proxy object.
|
|
|
|
+ // NOTE: This MUST be done before the state is reset otherwise we'll be touching uninitialized stuff.
|
|
|
|
+ mpProxyWriteNode = NULL;
|
|
|
|
+ mpProxyObject = NULL;
|
|
|
|
+
|
|
resetState();
|
|
resetState();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -218,6 +210,10 @@ public:
|
|
|
|
|
|
virtual void resetState( void )
|
|
virtual void resetState( void )
|
|
{
|
|
{
|
|
|
|
+ // We don't need to delete the write node as it'll get destroyed when the compilation is reset!
|
|
|
|
+ mpProxyWriteNode = NULL;
|
|
|
|
+ mpProxyObject = NULL;
|
|
|
|
+
|
|
// Cache the children.
|
|
// Cache the children.
|
|
while ( mChildren.size() > 0 )
|
|
while ( mChildren.size() > 0 )
|
|
{
|
|
{
|
|
@@ -247,6 +243,10 @@ public:
|
|
mNodeName = StringTable->insert( pNodeName );
|
|
mNodeName = StringTable->insert( pNodeName );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void set( const char* pNodeName, SimObject* pProxyObject );
|
|
|
|
+
|
|
|
|
+ void setWriteNode( TamlWriteNode* pWriteNode );
|
|
|
|
+
|
|
TamlCustomNode* addNode( const char* pNodeName, const bool ignoreEmpty = true )
|
|
TamlCustomNode* addNode( const char* pNodeName, const bool ignoreEmpty = true )
|
|
{
|
|
{
|
|
// Create a custom node.
|
|
// Create a custom node.
|
|
@@ -467,6 +467,12 @@ public:
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ inline bool isProxyObject( void ) const { return mpProxyObject != NULL; }
|
|
|
|
+ SimObject* getProxyObject( void ) const { return mpProxyObject != NULL ? mpProxyObject : NULL; }
|
|
|
|
+ inline const TamlWriteNode* getProxyWriteNode( void ) const { return mpProxyWriteNode; }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
const TamlCustomNodeVector& getChildren( void ) const { return mChildren; }
|
|
const TamlCustomNodeVector& getChildren( void ) const { return mChildren; }
|
|
const TamlCustomFieldVector& getFields( void ) const { return mFields; }
|
|
const TamlCustomFieldVector& getFields( void ) const { return mFields; }
|
|
|
|
|
|
@@ -474,6 +480,9 @@ public:
|
|
Vector<TamlCustomNode*> mChildren;
|
|
Vector<TamlCustomNode*> mChildren;
|
|
TamlCustomFieldVector mFields;
|
|
TamlCustomFieldVector mFields;
|
|
bool mIgnoreEmpty;
|
|
bool mIgnoreEmpty;
|
|
|
|
+
|
|
|
|
+ SimObject* mpProxyObject;
|
|
|
|
+ TamlWriteNode* mpProxyWriteNode;
|
|
};
|
|
};
|
|
|
|
|
|
static FactoryCache<TamlCustomNode> TamlCustomNodeFactory;
|
|
static FactoryCache<TamlCustomNode> TamlCustomNodeFactory;
|