public override void Execute(EventInfoCollection eventCollection, UnityAction OnFinish) { TriggerNum--; if (TriggerNum <= 0) { Enable = false; } base.Execute(eventCollection, OnFinish); }
public override void Execute(EventInfoCollection eventCollection, UnityAction OnFinish) { if (TriggerOnceOnly) { Enable = false; } HasTrigger = true; base.Execute(eventCollection, OnFinish); }
public static StackHashEventInfoCollection GetEventInfoApi(ref Login login, Event theEvent) { EventInfoCollection eventInfos = theEvent.GetEventDetails(ref login); StackHashEventInfoCollection apiStackHashEventInfos = new StackHashEventInfoCollection(); foreach (EventInfo eventInfo in eventInfos) { StackHashEventInfo stackHashEventInfo = ObjectConversion.ConvertEventInfo(eventInfo); apiStackHashEventInfos.Add(stackHashEventInfo); } return(apiStackHashEventInfos); }
/// <summary> /// 执行Sequence /// </summary> public virtual void Execute(EventInfoCollection eventCollection, UnityAction OnFinish) { UnityEngine.Assertions.Assert.IsNotNull(Sequence, "即将执行的Sequence为Null"); Sequence.EventRef = this; HasTrigger = true; Sequence.Execute(OnFinish); foreach (var s in Switcher) { var switchEvent = eventCollection.GetEventBase(s.EventType, s.EventID); if (switchEvent == null) { Debug.LogError("The Event u want switch enable is null"); } else { switchEvent.Enable = s.Enable; } } }
public void SaveBattle(int teamIndex, int chapterId, int mapId, Warehouse ware, List <CharacterInfo> infos, EventInfoCollection eventInfo) { BattleInfoCollection battleInfo = new BattleInfoCollection(); battleInfo.Slot = -1; battleInfo.CurrentTeamIndex = teamIndex; battleInfo.MapID = mapId; ChapterRecordCollection.TeamCollection teamData = new ChapterRecordCollection.TeamCollection(); teamData.AfterStartSequence = true; teamData.Chapter = chapterId; teamData.Ware = ware; teamData.PlayersInfo = new PlayerInfoCollection(); foreach (var v in infos) { teamData.PlayersInfo.AddContent(v); } battleInfo.team[teamIndex] = teamData; battleInfo.Event = eventInfo; battleInfo.Save(); }
public override void Execute(EventInfoCollection eventCollection, UnityAction OnFinish) { Enable = false; base.Execute(eventCollection, OnFinish); }
private void UpdateEvents(DateTime lastPullDate, IErrorIndex errorIndex, StackHashProduct stackHashProduct, bool getCabs, ApplicationFile file, StackHashFile stackHashFile) { // Get the events for the file with the start date as last pull date + 1. // Only stores the last 90 days worth - this will exception if you specify a date // before that time. In the case of the last pulldown date being close to 90 days ago // just get ALL the events. DateTime startTime = lastPullDate; // This is a local time. EventPageReader eventPageReader; TimeSpan timeSinceLastSync = (DateTime.UtcNow - lastPullDate.ToUniversalTime()); if (timeSinceLastSync.Days >= 89) { StackHashUtilities.DiagnosticsHelper.LogMessage(DiagSeverity.Information, String.Format(CultureInfo.InvariantCulture, "Updating Events for {0} {1} ALL", stackHashProduct.Name, stackHashFile.Name)); eventPageReader = file.GetEvents(); // Get all events. } else { StackHashUtilities.DiagnosticsHelper.LogMessage(DiagSeverity.Information, String.Format(CultureInfo.InvariantCulture, "Updating Events for {0} {1} since {2} {3}", stackHashProduct.Name, stackHashFile.Name, startTime, startTime.Kind)); eventPageReader = file.GetEvents(startTime); } // Read each page of new events. while (eventPageReader.Read(ref m_Login) == true) { if (m_AbortRequested) { throw new OperationCanceledException("Abort requested during Win Qual synchronize"); } // Get the events for the page. EventReader events = eventPageReader.Events; while (events.Read() == true) { if (m_AbortRequested) { throw new OperationCanceledException("Abort requested during Win Qual synchronize"); } // Get the event Event dpEvent = events.Event; StackHashEvent stackHashEvent = ObjectConversion.ConvertEvent(dpEvent, stackHashFile.Id); m_SyncProgress.EventId = stackHashEvent.Id; m_SyncProgress.EventTypeName = stackHashEvent.EventTypeName; // Check the date created. If it is greater than the last // pull date then this is a new event and hence insert. if (dpEvent.DateCreatedLocal > lastPullDate) { errorIndex.AddEvent(stackHashProduct, stackHashFile, stackHashEvent); } else if (dpEvent.DateModifiedLocal > lastPullDate) { // update the event information if event modified // date is greater than the last pull date errorIndex.AddEvent(stackHashProduct, stackHashFile, stackHashEvent); } else { // Check if the event exists. If not then add it. if (!errorIndex.EventExists(stackHashProduct, stackHashFile, stackHashEvent)) { errorIndex.AddEvent(stackHashProduct, stackHashFile, stackHashEvent); } } // Get the details for the event. EventInfoCollection infoCollection = dpEvent.GetEventDetails(ref m_Login); // Loop through the event info. StackHashEventInfo stackHashEventInfo = null; StackHashEventInfoCollection stackHashEventInfoCollection = new StackHashEventInfoCollection(); foreach (EventInfo info in infoCollection) { if (m_AbortRequested) { throw new OperationCanceledException("Abort requested during Win Qual synchronize"); } stackHashEventInfo = ObjectConversion.ConvertEventInfo(info); stackHashEventInfoCollection.Add(stackHashEventInfo); } errorIndex.MergeEventInfoCollection(stackHashProduct, stackHashFile, stackHashEvent, stackHashEventInfoCollection); // Now get the total hits. StackHashEventInfoCollection newEventInfos = errorIndex.LoadEventInfoList(stackHashProduct, stackHashFile, stackHashEvent); int hits = 0; foreach (StackHashEventInfo theEvent in newEventInfos) { hits += theEvent.TotalHits; } // Update the hits count. stackHashEvent.TotalHits = hits; errorIndex.AddEvent(stackHashProduct, stackHashFile, stackHashEvent); if (getCabs) { UpdateCabs(lastPullDate, errorIndex, stackHashProduct, dpEvent, stackHashFile, stackHashEvent); } } } }