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 RemoveComponent(GameComponent component)
 {
     RemovalMutex.WaitOne();
     Removals.Add(component);
     RemovalMutex.ReleaseMutex();
 }