public IValue <object> CalcValue(ScriptableData.ISyntaxComponent param)
 {
     if (param.IsValid() && param.GetId().Length == 0)
     {
         //处理括弧
         ScriptableData.CallData callData = param as ScriptableData.CallData;
         if (null != callData && callData.GetParamNum() > 0)
         {
             int ct = callData.GetParamNum();
             return(CalcValue(callData.GetParam(ct - 1)));
         }
         else
         {
             //不支持的语法
             return(null);
         }
     }
     else
     {
         IValue <object> ret = null;
         string          id  = param.GetId();
         IValueFactory   factory;
         if (m_ValueHandlers.TryGetValue(id, out factory))
         {
             ret = factory.Build(param);
         }
         return(ret);
     }
 }
Exemple #2
0
 public IStoryValue <object> CalcValue(ScriptableData.ISyntaxComponent param)
 {
     if (param.IsValid() && param.GetId().Length == 0)
     {
         //处理括弧
         ScriptableData.CallData callData = param as ScriptableData.CallData;
         if (null != callData && callData.GetParamNum() > 0)
         {
             int ct = callData.GetParamNum();
             return(CalcValue(callData.GetParam(ct - 1)));
         }
         else
         {
             //不支持的语法
             return(null);
         }
     }
     else
     {
         IStoryValue <object> ret = null;
         string id = param.GetId();
         if (m_dicValueHandlers.ContainsKey(id))
         {
             ret = m_dicValueHandlers[id].Build(param);
         }
         return(ret);
     }
 }