InitScreens() 공개 메소드

public InitScreens ( ScreenHandler>.Dictionary screens ) : void
screens ScreenHandler>.Dictionary
리턴 void
예제 #1
0
        public void TryLoad(StageLinkInfo info)
        {
            var       stageReader = Game.CurrentGame.FileReaderProvider.GetStageReader(info.StagePath);
            StageInfo map         = stageReader.Load(info.StagePath);

            var handler = new StageHandler(map);

            var joins = new Dictionary <ScreenInfo, Dictionary <Join, JoinHandler> >();

            foreach (var screen in map.Screens.Values)
            {
                joins[screen] = new Dictionary <Join, JoinHandler>();
            }

            foreach (Join join in map.Joins)
            {
                var screenOne = map.Screens[join.screenOne];
                var screenTwo = map.Screens[join.screenTwo];

                JoinHandler handlerOne = CreateJoin(join, handler, screenOne);

                joins[screenOne].Add(join, handlerOne);

                JoinHandler handlerTwo = CreateJoin(join, handler, screenTwo);

                joins[screenTwo].Add(join, handlerTwo);
            }

            var screens = new Dictionary <string, ScreenHandler>();

            foreach (var screen in map.Screens.Values)
            {
                screens[screen.Name] = CreateScreen(handler, screen, joins[screen].Values.ToList());
            }

            handler.InitScreens(screens);

            handler.WinHandler = info.WinHandler;

            if (info.LoseHandler == null)
            {
                // repeat this stage
                handler.LoseHandler = new HandlerTransfer {
                    Fade = true, Type = HandlerType.Stage, Name = info.Name
                };
            }
            else
            {
                handler.LoseHandler = info.LoseHandler;
            }

            _loadedStages[info.Name] = handler;
        }
예제 #2
0
        public void TryLoad(StageLinkInfo info)
        {
            var stageReader = new StageXmlReader();
            StageInfo map = stageReader.LoadStageXml(info.StagePath);

            var handler = new StageHandler(map);

            var joins = new Dictionary<ScreenInfo, Dictionary<Join, JoinHandler>>();

            foreach (var screen in map.Screens.Values)
            {
                joins[screen] = new Dictionary<Join, JoinHandler>();
            }

            foreach (Join join in map.Joins)
            {
                var screenOne = map.Screens[join.screenOne];
                var screenTwo = map.Screens[join.screenTwo];

                JoinHandler handlerOne = CreateJoin(join, handler, screenOne);

                joins[screenOne].Add(join, handlerOne);

                JoinHandler handlerTwo = CreateJoin(join, handler, screenTwo);

                joins[screenTwo].Add(join, handlerTwo);
            }

            var screens = new Dictionary<string, ScreenHandler>();
            foreach (var screen in map.Screens.Values)
            {
                screens[screen.Name] = CreateScreen(handler, screen, joins[screen].Values.ToList());
            }

            handler.InitScreens(screens);

            handler.WinHandler = info.WinHandler;

            if (info.LoseHandler == null)
            {
                // repeat this stage
                handler.LoseHandler = new HandlerTransfer { Fade = true, Type = HandlerType.Stage, Name = info.Name };
            }
            else
            {
                handler.LoseHandler = info.LoseHandler;
            }

            _loadedStages[info.Name] = handler;
        }