public override void Execute() { if (Globals.LoopMonsterUid > 0) { FailedMoveMonster = gMDB[Globals.LoopMonsterUid]; Debug.Assert(FailedMoveMonster != null); Debug.Assert(Globals.LoopFailedMoveMemberCount >= 0); FailedMoveMonster.CurrGroupCount += Globals.LoopFailedMoveMemberCount; Globals.LoopFailedMoveMemberCount = 0; } while (true) { Globals.LoopMonsterUid++; LoopMonster = gMDB[Globals.LoopMonsterUid]; if (LoopMonster != null) { if (LoopMonster.ShouldProcessInGameLoop()) { NextState = Globals.CreateInstance <IMonsterActionState>(); goto Cleanup; } } else { goto Cleanup; } } Cleanup: if (NextState == null) { NextState = Globals.CreateInstance <IEndOfRoundState>(); } Globals.NextState = NextState; }