Exemplo n.º 1
0
 public void Push(Scene nextScene)
 {
     sceneList.AddLast(nextScene);
     nextScene.Initialize();
     nextScene.LayoutComponents();
     nextScene.Activated();
 }
Exemplo n.º 2
0
        public GameLogic Generate(GameBase game, Scene scene, double textureScale)
        {
            var args = new object[] { game, scene, textureScale };
            var sum = 0;
            foreach (var specialInfo in infos)
            {
                sum += specialInfo.weight;
            }
            var threshold = sum * random.NextDouble();

            foreach (var specialInfo in infos)
            {
                threshold -= specialInfo.weight;
                if (threshold <= 0)
                {
                    return CreateGameLogic(specialInfo, args);
                }
            }

            return CreateGameLogic(infos[0], args);
        }
Exemplo n.º 3
0
 public void Swap(Scene nextScene, bool runGC = false)
 {
     Pop();
     Push(nextScene);
 }
Exemplo n.º 4
0
 public Scene GetParent(Scene scene)
 {
     return sceneList.FindLast(scene).Previous.Value;
 }
Exemplo n.º 5
0
 public BlackoutSwitchScene(GameBase game, Scene next)
     : base(game)
 {
     this.next = next;
     elapsed = 0;
 }