public void AddObjs(IEnumerable <IGameObj> o) { foreach (IGameObj go in o) { NewObjs.Add(go); } }
private void UpdateObjects() { foreach (IGameObj o in DeadObjs) { o.Die(this); Objs.Remove(o); } DeadObjs.Clear(); foreach (IGameObj o in NewObjs) { Objs.Add(o); } NewObjs.Clear(); }
// Crap, when must this happen? // It can happen whenever Objs is the current state... which is thoretically always. // This will nuke the particles though. // This is actually pretty close to correct. public void SetLevel(int level) { UpdateObjects(); Objs.Remove(Player); Levels[CurrentLevel].Objs = Objs; // This is PROBABLY right, but I'm not sure. CurrentLevel = level; Objs = Levels[CurrentLevel].Objs; Objs.Add(Player); NewObjs.Clear(); DeadObjs.Clear(); Particles.Clear(); NewParticles.Clear(); DeadParticles.Clear(); UpdateCollisionTree(); }
public void AddObj(IGameObj o) { NewObjs.Add(o); }