/*------------------------------------------------*/ public void EnterState() { // allocation of dataz doubleBuffer = new DoubleBuffer(); renderManager = new ShooterRender(doubleBuffer, StateManager.Instance.GameInstance); updateManager = new ShooterUpdater(doubleBuffer, StateManager.Instance.GameInstance); // load game object's "update/render data" to both the update/render managers // TODO: These need to be removed and initialized only when the designated player // presses start to join shooter02.GameObjects.CPlayer temp = ObjectFactory.CreatePlayer1('1'); updateManager.GameDataObjects.Add(temp.UpdateData); renderManager.RenderDataObjects.Add(temp.RenderData); ObjectManager.CObjectManager.Instance.AddObject(temp); shooter02.GameObjects.CPlayer temp2 = ObjectFactory.CreatePlayer2('1'); updateManager.GameDataObjects.Add(temp2.UpdateData); renderManager.RenderDataObjects.Add(temp2.RenderData); ObjectManager.CObjectManager.Instance.AddObject(temp2); shooter02.GameObjects.CPlayer temp3 = ObjectFactory.CreatePlayer3('1'); updateManager.GameDataObjects.Add(temp3.UpdateData); renderManager.RenderDataObjects.Add(temp3.RenderData); ObjectManager.CObjectManager.Instance.AddObject(temp3); shooter02.GameObjects.CPlayer temp4 = ObjectFactory.CreatePlayer4('1'); updateManager.GameDataObjects.Add(temp4.UpdateData); renderManager.RenderDataObjects.Add(temp4.RenderData); ObjectManager.CObjectManager.Instance.AddObject(temp4); ////////////////////////////////////////////////////////////////////////////// // start the update function on a new thread updateManager.StartOnNewThread(); }
public UpdateManager(DoubleBuffer doubleBuffer, Game game) { this.doubleBuffer = doubleBuffer; this.game = game; this.GameDataObjects= new List<UpdateData>(); }
public ShooterRender(DoubleBuffer doubleBuffer, Game game) : base(doubleBuffer, game) { }
public ShooterUpdater(DoubleBuffer doubleBuffer, Game game) : base(doubleBuffer, game) { }
public RenderManager(DoubleBuffer doubleBuffer, Game game) { this.doubleBuffer = doubleBuffer; this.game = game; this.RenderDataObjects = new List<RenderData>(); }