public void RemoveSceneObject(GameObject2D sceneobject) { if (SceneObjects2D.Remove(sceneobject)) { sceneobject.Scene = null; } }
public void AddSceneObject(GameObject2D sceneobject) { if (!SceneObjects2D.Contains(sceneobject)) { sceneobject.Scene = this; SceneObjects2D.Add(sceneobject); } }
//public virtual void LoadParticle(Microsoft.Xna.Framework.Content.ContentManager contentmanager, SpriteBatchRenderer particleRenderer) //{ // objectsWithParticle.ForEach(objectwithparticle => objectwithparticle.LoadParticle(contentmanager, particleRenderer)); //} public virtual void Update(RenderContext rendercontext, ContentManager contentmanager) { SceneObjects2D.ForEach(sceneobject => sceneobject.Update(rendercontext)); HUDObjects2DBack.ForEach(hudobject => hudobject.Update(rendercontext)); HUDObjects2DFront.ForEach(hudobject => hudobject.Update(rendercontext)); }
//public virtual void DrawParticle(RenderContext rendercontext) //{ // objectsWithParticle.ForEach(objectwithparticle => objectwithparticle.DrawParticle(rendercontext)); //} //public virtual void DrawBGParticle(RenderContext rendercontext) //{ // bg_particle.DrawParticle(rendercontext); //} public virtual void LoadContent(ContentManager contentmanager) { SceneObjects2D.ForEach(sceneobject => sceneobject.LoadContent(contentmanager)); HUDObjects2DBack.ForEach(hudobject => hudobject.LoadContent(contentmanager)); HUDObjects2DFront.ForEach(hudobject => hudobject.LoadContent(contentmanager)); }
public virtual void Draw(RenderContext rendercontext) { SceneObjects2D.ForEach(sceneobject => sceneobject.Draw(rendercontext)); }
//public void AddObjectWithParticle(ObjectWithParticle hudObject) //{ // if (!objectsWithParticle.Contains(hudObject)) // { // objectsWithParticle.Add(hudObject); // } //} //public void RemoveObjectWithParticle(ObjectWithParticle hudObject) //{ // if (objectsWithParticle.Remove(hudObject)) // { // } //} public virtual void Initialize() { SceneObjects2D.ForEach(sceneobject => sceneobject.Initialize()); HUDObjects2DBack.ForEach(hudobject => hudobject.Initialize()); HUDObjects2DFront.ForEach(hudobject => hudobject.Initialize()); }