private void SendFightEventGroupToExecution(FightStatus activeFightStatus) { int count = s_eventGroupBuffer.Count; if (count == 1) { FightEvent fightEvent = s_eventGroupBuffer[0]; try { if (fightEvent.SynchronizeExecution()) { Execute(SetupSynchronizationBarrier()); IEnumerator enumerator = fightEvent.UpdateView(activeFightStatus); if (enumerator != null) { Execute(enumerator); } Execute(ReleaseSynchronizationBarrier()); } else { IEnumerator enumerator2 = fightEvent.UpdateView(activeFightStatus); if (enumerator2 != null) { Execute(enumerator2); } } } catch (Exception ex) { Log.Error($"Exception occured while event {fightEvent.eventType} #{fightEvent.eventId} updated fight view.", 255, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightLogicExecutor.Instance.cs"); Debug.LogException(ex); } } else { IEnumerator[] array = new IEnumerator[count]; for (int i = 0; i < count; i++) { FightEvent fightEvent2 = s_eventGroupBuffer[i]; try { array[i] = fightEvent2.UpdateView(activeFightStatus); } catch (Exception ex2) { Log.Error($"Exception occured while event {fightEvent2.eventType} #{fightEvent2.eventId} updated fight view.", 273, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightLogicExecutor.Instance.cs"); Debug.LogException(ex2); } } IEnumerator action = EnumeratorUtility.ParallelRecursiveImmediateExecution(array); Execute(action); } s_eventGroupBuffer.Clear(); }
private static void RevertFightMapTargetingPhase(FightMap fightMap) { FightStatus local = FightStatus.local; if (local != null && local.currentTurnPlayerId == s_playerCasting.id) { if (fightMap.IsInTargetingPhase()) { fightMap.SetMovementPhase(); } } else { fightMap.EndCurrentPhase(); } }
public Instance(FightStatus fightStatus) { this.fightStatus = fightStatus; }
public static void AddFightStatus(FightStatus fightStatus) { s_instances[fightStatus.fightId] = new Instance(fightStatus); }
private void ProcessFightEventsUpdateViews(List <FightEvent> fightEvents, FightStatus activeFightStatus) { int num = 1; int count = fightEvents.Count; FightEvent fightEvent = fightEvents[0]; s_eventGroupBuffer.Add(fightEvent); while (num < count && fightEvent.IsInvisible()) { FightEvent fightEvent2 = fightEvents[num]; num++; s_eventGroupBuffer.Add(fightEvent2); fightEvent = fightEvent2; } while (num < count) { FightEvent fightEvent3 = fightEvents[num]; num++; if (!fightEvent3.IsInvisible() && !fightEvent3.CanBeGroupedWith(fightEvent)) { SendFightEventGroupToExecution(activeFightStatus); } s_eventGroupBuffer.Add(fightEvent3); fightEvent = fightEvent3; } SendFightEventGroupToExecution(activeFightStatus); }
private void ProcessFightEventsUpdateStatus(List <FightEvent> fightEvents, FightStatus activeFightStatus) { m_dirtyEntitiesCounter = 0; m_dirtySpellsCounters.ResetAll(); int count = fightEvents.Count; for (int i = 0; i < count; i++) { FightEvent fightEvent = fightEvents[i]; long? num = fightEvent.parentEventId; if (num.HasValue) { s_eventHierarchyBuffer[num.Value].AddChildEvent(fightEvent); } try { fightEvent.UpdateStatus(activeFightStatus); } catch (Exception ex) { Log.Error($"Exception occured while event {fightEvent.eventType} #{fightEvent.eventId} updated fight status.", 144, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightLogicExecutor.Instance.cs"); Debug.LogException(ex); } s_eventHierarchyBuffer.Add(fightEvent.eventId, fightEvent); } try { activeFightStatus.TriggerUpdateEvents(); } catch (Exception ex2) { Log.Error($"Exception occured while triggering update events of fight status #{activeFightStatus.fightId}.", 163, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightLogicExecutor.Instance.cs"); Debug.LogException(ex2); } s_eventHierarchyBuffer.Clear(); }