Ejemplo n.º 1
0
        public void HandleAddRemoves()
        {
            AdditionMutex.WaitOne();
            foreach (GameComponent component in Additions)
            {
                AddComponentImmediate(component);
            }

            Additions.Clear();
            AdditionMutex.ReleaseMutex();

            RemovalMutex.WaitOne();
            foreach (GameComponent component in Removals)
            {
                RemoveComponentImmediate(component);
            }

            Removals.Clear();
            RemovalMutex.ReleaseMutex();
        }
Ejemplo n.º 2
0
 public void AddComponent(GameComponent component)
 {
     AdditionMutex.WaitOne();
     Additions.Add(component);
     AdditionMutex.ReleaseMutex();
 }