示例#1
0
        public static EffectMobile Create(Point3D p, Map map, TimeSpan duration)
        {
            EffectMobile mobile = null;

            for (int i = m_Free.Count - 1; mobile == null && i >= 0; --i) // We reuse new entries first so decay works better
            {
                EffectMobile free = m_Free[i];

                m_Free.RemoveAt(i);

                if (!free.Deleted && free.Map == Map.Internal)
                {
                    mobile = free;
                }
            }

            if (mobile == null)
            {
                mobile = new EffectMobile();
            }

            mobile.MoveToWorld(p, map);
            mobile.BeginFree(duration);

            return(mobile);
        }
示例#2
0
 public FreeTimer(EffectMobile mobile, TimeSpan delay)
     : base(delay)
 {
     m_Mobile = mobile;
     Priority = TimerPriority.OneSecond;
 }