Example #1
0
        public ScenarioBuilderController(ScenarioBuilder ScenarioBuilder, ScenarioBuilderScreen Screen)
        {
            _ScenarioBuilder = ScenarioBuilder;
            _Screen          = Screen;

            _Screen.OnParametersChanged      = HandleParametersChanged;
            _Screen.OnArmyAdded             += HandleArmyAdded;
            _Screen.OnArmyParametersChanged += HandleArmyParametersChanged;
            _Screen.OnArmyRemoved           += HandleArmyRemoved;
            _Screen.OnFinished += HandleFinished;
        }
        public override Pod SetupState(ProgramContext ProgramContext, ProgramStateContext ProgramStateContext)
        {
            var defaultParameters =
                new ScenarioParameters(
                    1939, GameData.MatchSettings.Values.First(), 8, new Coordinate(33, 33), false);

            _ScenarioBuilder = new ScenarioBuilder(defaultParameters);

            var screen = new ScenarioBuilderScreen(ProgramContext.ScreenResolution, _ScenarioBuilder);

            screen.OnMainMenuButtonClicked += HandleBack;

            _Controller             = new ScenarioBuilderController(_ScenarioBuilder, screen);
            _Controller.OnFinished += HandleFinished;

            return(screen);
        }