示例#1
0
文件: Boot.cs 项目: torybash/TankGame
        private void BootGame()
        {
            //Setting up controllers, databases, flow-stack etc.

            //Core functionality
            var viewDatabase   = databaseHelper.Get <ViewDatabase>();
            var viewController = new ViewController(viewDatabase);
            var flowStack      = new FlowStack();

            //Game, map, battle
            var tankDatabase  = databaseHelper.Get <TankDatabase>();
            var crewDatabase  = databaseHelper.Get <CrewDatabase>();
            var cardsDatabase = databaseHelper.Get <CardsDatabase>();
            var activeCardsPanelLifecycleHandler = new ActiveCardsPanelLifecycleHandler(viewController);
            var abilitiesPanelLifecycleHandler   = new AbilitiesPanelLifecycleHandler(tankDatabase);
            var tankPanelLifecycleHandler        = new TankPanelLifecycleHandler();
            var dragAndDropArrow      = new DragAndDropArrowController(viewController);
            var battleHUD             = new BattleHUD(viewController, activeCardsPanelLifecycleHandler, abilitiesPanelLifecycleHandler, tankPanelLifecycleHandler, dragAndDropArrow);
            var gameControllerFactory = new GameControllerFactory(flowStack, viewController, battleHUD, tankDatabase, crewDatabase, cardsDatabase);

            //Main menu
            var mainMenuControllerFactory = new MainMenuControllerFactory(flowStack, viewController, gameControllerFactory);

            //Start Flow
            var menuFlow = new MainMenuFlow(mainMenuControllerFactory);

            flowStack.Push(menuFlow);
        }
示例#2
0
        private void OnDestinationSelected(string destinationId)
        {
            var battleState = DEBUG_GetTestBattle();

            var battleFlow = new BattleFlow(gameControllerFactory, battleState);

            flowStack.Push(battleFlow);

            IsSelectingDestination = false;
        }
示例#3
0
        private void OnStart()
        {
            var gameFlow = new GameFlow(gameControllerFactory);

            flowStack.Push(gameFlow);
        }