Example #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--;
     }
 }
Example #2
0
            private IList <FreeLog.LogKey> GetParents()
            {
                IList <FreeLog.LogKey> list = new List <FreeLog.LogKey>();
                IList <FreeLog.LogKey> all  = new List <FreeLog.LogKey>();

                foreach (FreeLog.LogKey lk in value.Values)
                {
                    all.Add(0, lk);
                }
                list.Add(this);
                int deep = index;

                for (int i = 0; i < all.Count; i++)
                {
                    if (all[i] == this)
                    {
                        for (int j = i + 1; j < all.Count; j++)
                        {
                            FreeLog.LogKey lk_1 = all[j];
                            if (lk_1.para.Equals(this.para) && lk_1.to != null)
                            {
                                if (lk_1.index == deep - 1)
                                {
                                    list.Add(0, lk_1);
                                    deep = lk_1.index;
                                }
                            }
                        }
                    }
                }
                return(list);
            }
Example #3
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj == null)
     {
         return(false);
     }
     if (GetType() != obj.GetType())
     {
         return(false);
     }
     FreeLog.LogKey other = (FreeLog.LogKey)obj;
     if (action == null)
     {
         if (other.action != null)
         {
             return(false);
         }
     }
     else
     {
         if (!action.Equals(other.action))
         {
             return(false);
         }
     }
     if (para == null)
     {
         if (other.para != null)
         {
             return(false);
         }
     }
     else
     {
         if (!para.Equals(other.para))
         {
             return(false);
         }
     }
     if (s != other.s)
     {
         return(false);
     }
     return(true);
 }
Example #4
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);
 }