Esempio n. 1
0
 public override void Draw(SpriteBatch batch, GameTime time)
 {
     foreach (var component in GameComponents.Cast <DrawableGameComponent>().OrderBy(t => t.UpdateOrder).Where(t => t.Visible))
     {
         component.Draw(batch, time);
     }
     SceneManager.Draw(batch, time);
     batch.End();
 }
Esempio n. 2
0
        public void JoinGame()
        {
            foreach (var component in GameComponents.Cast <DrawableGameComponent>())
            {
                component.Enabled = false;
                component.Visible = false;
            }

            var multiplayer = (DrawableGameComponent)GameComponents.First(t => t.GetType() == typeof(MultiplayerComponent));

            multiplayer.Enabled = true;
            multiplayer.Visible = true;
        }