Ejemplo n.º 1
0
 public static void Stop(long s, IGameAction action, IEventArgs args)
 {
     if (enable)
     {
         foreach (ParaExp pe in paras)
         {
             IPara p = GetPara(args, pe);
             if (p != null)
             {
                 FreeLog.LogKey key = new FreeLog.LogKey(s, pe.ToString(), action.ToString());
                 if (value.ContainsKey(key))
                 {
                     if (!value[key].GetFrom().Meet("==", p))
                     {
                         // 去除外层的改变action
                         FreeLog.LogKey v = value[key];
                         if (v.seq > lastSeq)
                         {
                             v.to = (IPara)p.Copy();
                             logs.Add(v);
                             lastSeq = v.seq;
                         }
                         value[key].to = (IPara)p.Copy();
                     }
                 }
             }
         }
         index--;
     }
 }
Ejemplo n.º 2
0
 private void AddTo(string[] fields, IParable target, ParaList to)
 {
     foreach (string field in fields)
     {
         FieldPair fp = FieldPair.Parse(field)[0];
         ParaList  tp = target.GetParameters();
         if (tp.HasPara(fp.GetFrom()))
         {
             IPara para = tp.Get(fp.GetFrom());
             if (para != null)
             {
                 IPara clone = (IPara)para.Copy();
                 clone.SetName(fp.GetTo());
                 if (@override || !to.HasPara(fp.GetTo()))
                 {
                     to.AddPara(clone);
                 }
                 else
                 {
                     to.AddPara(clone);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public static long Start(IGameAction action, IEventArgs args)
 {
     if (enable)
     {
         long s = Runtime.NanoTime();
         foreach (ParaExp pe in paras)
         {
             IPara p = GetPara(args, pe);
             if (p != null)
             {
                 FreeLog.LogKey key = new FreeLog.LogKey(s, pe.ToString(), action.ToString());
                 key.index  = index;
                 key.seq    = value.Count + 1;
                 key.from   = (IPara)p.Copy();
                 value[key] = key;
             }
         }
         index++;
         return(s);
     }
     return(0L);
 }