template <typename T> void CScriptSerializableNode::setAttrTemplateRef(const CSerializationID& keyID, const T& value) { lua_State* L = GetScriptState(); lua_getref(L, m_table); CScriptMarshal::PushData(L, value); lua_setfield(L, -2, keyID.GetString()); lua_pop(L, 1); }
void CTextNode::addChild(const CSerializationID& keyID, const ISerializableNode* child) { const CTextNode* textChild = static_cast<const CTextNode*>(child); XmlNodeRef cloneNode = textChild->m_constXmlNode->clone(); cloneNode->setTag(keyID.GetString()); m_xmlNode->addChild(cloneNode); RebuildChildrenList(); }
CScriptSerializableNode::CScriptSerializableNode(const CSerializationID& serializationId) : ISerializableNode(true) { lua_State* L = CScriptSystem::GetInstance()->GetLuaState(); lua_newtable(L); lua_pushstring(L, serializationId.GetString()); lua_rawseti(L, -2, 0); m_table = lua_ref(L, true); m_tag = serializationId; }
void CPropertyNode::setAttrRaw(const CSerializationID& keyID, const char* valueData, int typeId, int length) { BEHAVIAC_UNUSED_VAR(length); const CMemberBase* m = this->m_pAgent->FindMember(keyID.GetString()); if (m) { CMemberBase* pM = const_cast<CMemberBase*>(m); //pM->Set(this->m_pAgent, valueData, typeId); pM->SetVariable(this->m_pAgent, valueData, typeId); } }