Пример #1
0
        public void Update(double dt)
        {
            foreach (IActor actor in NewActors)
            {
                Actors.Add(actor);
            }

            NewActors.Clear();

            foreach (IActor actor in Actors)
            {
                actor.OnUpdate(dt);
                if (actor.MustBeDestroyed)
                {
                    ActorsToRemove.Add(actor);
                }
            }

            foreach (IActor actor in ActorsToRemove)
            {
                actor.OnDestroy();

                Game.PM.DeleteBoxComponent(actor.BC);
                Actors.Remove(actor);
            }

            ActorsToRemove.Clear();
        }
Пример #2
0
 public void Clear()
 {
     Actors.Clear();
     NewActors.Clear();
 }