public AIBaseData GetBaseData(string valueName, AIBaseData.DataType valueType) { if (m_baseDataDic.ContainsKey(valueName)) { return(m_baseDataDic[valueName]); } else { AIBaseData tmpAIBaseData = AIBaseData.CreateAIBaseData(valueType); m_baseDataDic.Add(valueName, tmpAIBaseData); return(tmpAIBaseData); } }
public override void Deserialize(XmlNode xmlNode) { base.Deserialize(xmlNode); XmlElement xmlElement = xmlNode as XmlElement; mSourValueType = xmlElement.GetAttribute("SourValueType"); mSourValueName = xmlElement.GetAttribute("SourValueName"); m_funcGetSourValue = GetValueFunction(mSourValueType, mSourValueName); mTarValueType = xmlElement.GetAttribute("TarValueType"); mTarValueName = xmlElement.GetAttribute("TarValueName"); m_funcGetTarValue = GetValueFunction(mTarValueType, mTarValueName); mValueType = AIBaseData.ChangeStrToDataType(xmlElement.GetAttribute("ValueType")); mCompareType = AIBaseData.ChangeStrToCompareType(xmlElement.GetAttribute("CompareType")); mValue = AIBaseData.CreateAIBaseData(mValueType); mValue.SetValue(xmlElement.GetAttribute("Value")); }
public override void Deserialize(XmlNode xmlNode) { base.Deserialize(xmlNode); XmlElement xmlElement = xmlNode as XmlElement; mObjType = xmlElement.GetAttribute("ObjectType"); mValueName = xmlElement.GetAttribute("ValueName"); if (mObjType == "Actor") { switch (mValueName) { case "HP": m_funcGetValue = FunctionalFuncBase.GetActorHPValue; m_funcSetValue = FunctionalFuncBase.SetActorHPValue; break; case "IsInitAIDataList": m_funcGetValue = FunctionalFuncBase.GetActorIsInitAIDataList; m_funcSetValue = FunctionalFuncBase.SetActorIsInitAIDataList; break; case "TrapIsActive": m_funcGetValue = FunctionalFuncBase.GetTrapIsActive; m_funcSetValue = FunctionalFuncBase.SetTrapIsActive; break; case "TrapIsAble": m_funcGetValue = FunctionalFuncBase.GetTrapIsAble; m_funcSetValue = FunctionalFuncBase.SetTrapIsAble; break; case "TrapState": m_funcGetValue = FunctionalFuncBase.GetTrapState; m_funcSetValue = FunctionalFuncBase.SetTrapState; break; case "TrapMaxAttackCount": m_funcGetValue = FunctionalFuncBase.GetTrapMaxAttackCount; m_funcSetValue = FunctionalFuncBase.SetTrapMaxAttackCount; break; case "TrapMinAttackTime": m_funcGetValue = FunctionalFuncBase.GetTrapMinAttackTime; m_funcSetValue = FunctionalFuncBase.SetTrapMinAttackTime; break; default: break; } } else if (mObjType == "AI") { m_funcGetValue = null; m_funcSetValue = null; } mValueType = AIBaseData.ChangeStrToDataType(xmlElement.GetAttribute("ValueType")); mSetType = AIBaseData.ChangeStrToSetType(xmlElement.GetAttribute("SetType")); mValue = AIBaseData.CreateAIBaseData(mValueType); if (mSetType != AIBaseData.SetType.enReset) { mValue.SetValue(xmlElement.GetAttribute("Value")); } }