public void _40_16_StackChangerFromCoroutineThenEmitEffectiveChangersKeepingConditionsWithProgress() { int frame = 0; var context0 = PlayerContext.Copy(dummyContext); var auto0 = new AutoForTest40_4 <PlayerContext, Dictionary <string, PlayerContext> >(frame, context0) as Auto <PlayerContext, Dictionary <string, PlayerContext> >; // stack changer from coroutine. auto0.Update(frame, new Dictionary <string, PlayerContext>()); frame++; // effective in this frame. progress auto will break situation. auto0.Update(frame, new Dictionary <string, PlayerContext>()); frame++; auto0.Update(frame, new Dictionary <string, PlayerContext>()); frame++; if (auto0.ShouldFalldown(frame)) { // choose effective (next frame of the changer stacked from coroutine.) var stackedChangers = auto0.StackedEffectiveChangers(); auto0 = auto0.EmitChangers(frame, context0, stackedChangers); if (auto0.ContainsCondition(AutoConditions.Act.P2)) { return; } } Debug.LogError("failed."); }
ChangerForTest40_3 <InitialParamType, UpdateParamType> (Auto <InitialParamType, UpdateParamType> baseAuto, int frame, InitialParamType fixedContext) { var conditions = baseAuto.Conditions(); /* * comment for branchName0 */ if ( ConditionGateway.Contains(conditions, AutoConditions.Act.P2) ) { var newAuto = new AutoForTest40_4 <InitialParamType, UpdateParamType>(frame, fixedContext); return(newAuto); } return(baseAuto); }