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); }
void HandleStateChange(object Sender, ProgramStateTransitionEventArgs E) { EnterState(E.TransitionState, E.ProgramStateContext); }