Exemplo n.º 1
0
 /// <summary>
 /// Call this when you are done with a dummy. The dummy will become available for use again after the <paramref name="recycleTime"/>.
 /// </summary>
 public static void RecycleDummy(unit dummy, float recycleTime = 2.0f)
 {
     if (dummiesBeingRecycled.Count == 0)
     {
         PeriodicEvents.AddPeriodicEvent(periodicEvent);
     }
     dummiesBeingRecycled.Add(new DummyBeingRecycled(dummy, (int)(recycleTime / PeriodicEvents.SYSTEM_INTERVAL)));
 }
Exemplo n.º 2
0
        internal static void StoreSynchronisedTime(int seconds, DateTimeSyncMethod method)
        {
            if (!offsetByMethod.ContainsKey(method))
            {
                if (baseTime < 0)
                {
                    baseTime = seconds;
                    PeriodicEvents.AddPeriodicEvent(() =>
                    {
                        baseTime++;
                        return(true);
                    }, 1f);
                }

                offsetByMethod.Add(method, seconds - baseTime);
            }
        }