public LogicArrayList <LogicCalendarEvent> GetActiveCalendarEvents(int minTimestamp, int maxTimestamp) { LogicArrayList <LogicCalendarEvent> activeCalendarEvents = new LogicArrayList <LogicCalendarEvent>(); for (int i = 0; i < this.m_calendarEvents.Size(); i++) { LogicCalendarEvent calendarEvent = this.m_calendarEvents[i]; if (calendarEvent.GetStartTime() <= minTimestamp && calendarEvent.GetEndTime() >= maxTimestamp) { activeCalendarEvents.Add(calendarEvent); } } return(activeCalendarEvents); }
public bool HasNewActiveCalendarEvents(LogicArrayList <LogicCalendarEvent> currentActiveCalendarEvents, int minTimestamp, int maxTimestamp) { int enableCalendarCount = 0; for (int i = 0, j = 0; i < this.m_calendarEvents.Size(); i++) { LogicCalendarEvent calendarEvent = this.m_calendarEvents[i]; if (calendarEvent.GetStartTime() <= minTimestamp && calendarEvent.GetEndTime() >= maxTimestamp) { if (j < currentActiveCalendarEvents.Size()) { if (!calendarEvent.IsEqual(currentActiveCalendarEvents[j++])) { return(true); } } ++enableCalendarCount; } } return(enableCalendarCount != currentActiveCalendarEvents.Size()); }