Ejemplo n.º 1
0
        public void Clear()
        {
            MyComponent c = new MyComponent(game);

            components.Add(c);
            Assert.AreEqual(1, components.Count, "Should contain 1 component");
            components.Clear();
            Assert.AreEqual(0, components.Count);
        }
Ejemplo n.º 2
0
        protected void SortComponentsByStackOrder()
        {
            IEnumerable <IGameComponent> query = components.OrderBy(comp => ((IStackable)comp).StackOrder);

            sortedComponents.Clear();
            for (int i = 0; i < query.Count(); i++)
            {
                sortedComponents.Add(query.ElementAt(i));
            }
        }
Ejemplo n.º 3
0
 private SyncedGameCollection(Game game) : base(game)
 {
     if (componentCollection != null)
     {
         componentCollection.Clear();
     }
     else
     {
         componentCollection = new GameComponentCollection();
     }
 }
Ejemplo n.º 4
0
        public void Reset()
        {
            if (welcomeSound != null)
            {
                welcomeSound.Stop();
            }

            //components.Remove(profil); profil = null;
            components.Remove(chooser); if (chooser != null)
            {
                chooser.Dispose();
            }
            chooser = null;
            components.Remove(intro); if (intro != null)
            {
                intro.Dispose();
            }
            intro = null;
            components.Remove(credits); if (credits != null)
            {
                credits.Dispose();
            }
            credits = null;
            components.Remove(menu); menu   = null;
            components.Remove(level); level = null;

            components.Remove(hud); hud         = null;
            components.Remove(console); console = null;

            components.Clear();

            if (game.World != null)
            {
                //components.Remove(game.World);
                game.World.Dispose();
                game.World = null;
            }

            /*
             * if (score != null)
             * {
             *  score.Reset();
             * }
             * score = null;*/
            Material.ClearSharedPool();
        }