예제 #1
0
        void HandleFinished(object Sender, EventArgs E)
        {
            ScenarioBuilder builder = ((ScenarioBuilderContext)_Context).ScenarioBuilder;
            ProgramStateTransitionEventArgs transition = null;

            if (builder.Armies.All(i => i.Validate()))
            {
                transition = new ProgramStateTransitionEventArgs(
                    ProgramState.MATCH,
                    new MatchContext(
                        new Match(builder.BuildScenario().MakeStatic(new Random()), new FullOrderAutomater())));
            }
            else
            {
                transition = new ProgramStateTransitionEventArgs(ProgramState.BUILD_ARMY, _Context);
            }
            OnProgramStateTransition(this, transition);
        }
예제 #2
0
 void HandleStateChange(object Sender, ProgramStateTransitionEventArgs E)
 {
     EnterState(E.TransitionState, E.ProgramStateContext);
 }