Ejemplo n.º 1
0
 public NewRepositorySerilizerEventArgs(eEventType EventType, string FilePath, string XML, RepositoryItemBase TargetObj)
 {
     this.EventType = EventType;
     this.FilePath  = FilePath;
     this.XML       = XML;
     this.TargetObj = TargetObj;
 }
Ejemplo n.º 2
0
        public static void TriggerMailByEvent(CharacterController character,
                                              eEventType type,
                                              int param0 = 0,
                                              int param1 = 0)
        {
            //获得该事件影响的条件
            var conlist = ConditionManager.EventTriggerCondition(type, param0);

            if (conlist == null)
            {
                return;
            }
            //整理这些条件影响了哪些邮件
            maillist.Clear();
            foreach (var i in conlist)
            {
                ConditionMail(character, maillist, i.Key);
            }
            //尝试接受这些邮件
            foreach (var i in maillist)
            {
                //character.mTask.TryAccept(character, i.Key);
                character.mMail.PushMail(i.Key);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates an instance of the Event object
 /// </summary>
 /// <example>
 /// <code>
 /// CEvent event = new CEvent(new DateTime(2006,1,1), HOLIDAY, 2, "Christmas");
 /// </code>
 /// </example>
 /// Revision History
 /// MM/DD/YY who Version Issue# Description
 /// -------- --- ------- ------ ---------------------------------------
 /// 02/15/06 rrr N/A	 N/A	Creation of class
 /// 04/26/06 rrr N/A	 N/A	Added a string parameter and instance variable
 ///								initialization
 public CEvent(DateTime objDate, eEventType eType, int intIndex, string strName)
 {
     m_strName    = strName;
     m_Date       = objDate;
     m_intIndex   = intIndex;
     m_eEventType = eType;
 }         //CEvent
Ejemplo n.º 4
0
        //根据事件找到所有影响的条件
        public Dictionary <int, int> EventTriggerCondition(eEventType type, int nParam)
        {
            //检查类型是否存在
            Dictionary <int, List <int> > ParamCondi;

            if (!ConditionManager.EventTypeList.TryGetValue(type, out ParamCondi))
            {
                return(null);
            }
            List <int> CondiList;

            //检查相应参数的Key是否存在
            if (!ParamCondi.TryGetValue(nParam, out CondiList))
            {
                return(null);
            }
            //整理任务
            var result = new Dictionary <int, int>();

            foreach (var i in CondiList)
            {
                result[i] = 1;
            }
            return(result);
        }
Ejemplo n.º 5
0
 public void Broadcasting <T, U>(eEventType eType, T arg1, U arg2)
 {
     _broadcasting.Add(new BroadcastInfo( )
     {
         eType = eType, obj1 = arg1, obj2 = arg2
     });
 }
Ejemplo n.º 6
0
 public RunnerItemEventArgs(eEventType EventType, RunnerItemPage runnerItemPage, RunnerItemPage.eRunnerItemType runnerItemType, object runnerItemObject)
 {
     this.EventType        = EventType;
     this.RunnerItemPage   = runnerItemPage;
     this.RunnerItemType   = runnerItemType;
     this.RunnerItemObject = runnerItemObject;
 }
Ejemplo n.º 7
0
 static void OnListenerRemoved(eEventType eventType)
 {
     if (m_EventTable[eventType] == null)
     {
         m_EventTable.Remove(eventType);
     }
 }
Ejemplo n.º 8
0
 public void Broadcasting <T>(eEventType eType, T arg1)
 {
     _broadcasting.Add(new BroadcastInfo( )
     {
         eType = eType, obj1 = arg1, obj2 = null
     });
 }
Ejemplo n.º 9
0
 public void Broadcasting(eEventType eType)
 {
     _broadcasting.Add(new BroadcastInfo( )
     {
         eType = eType, obj1 = null, obj2 = null
     });
 }
Ejemplo n.º 10
0
    public void SpawnEvent(bool type, Unit target)
    {
        if (!Live)
        {
            return;
        }

        //< 스킬이벤트가 활성화중일떈 나감
        if (EventUpdate && _eEventType == eEventType.Skill)
        {
            return;
        }

        if (ActiveEvent == type)
        {
            return;
        }

        ActiveEvent = type;
        StopAllCoroutines();

        //< 타겟 리스트를 구한다.
        if (type)
        {
            units.Clear();
            units.Add(target);
            SetLayer(target, 14);
        }

        _eEventType = eEventType.Spawn;
        StartCoroutine("CameraUpdate_Spawn", ActiveEvent);
    }
Ejemplo n.º 11
0
        //初始化一个条件(当事件来的时候,知道哪个条件会被有修改)
        private void InitOneType(eEventType type, int nConditionId, int nParam)
        {
            //是否只有任务需要整理条件,如果是的话,发现条件能触发任务才继续整理
            var IsOnlyMission = false;

            if (IsOnlyMission)
            {
                if (!MissionManager.CheckConditionEventMission(nConditionId))
                {
                    return;
                }
            }
            //检查类型是否存在,不存在则造一个
            Dictionary <int, List <int> > paramCondi;

            if (!ConditionManager.EventTypeList.TryGetValue(type, out paramCondi))
            {
                paramCondi = new Dictionary <int, List <int> >();
                ConditionManager.EventTypeList[type] = paramCondi;
            }
            //检查相应参数的Key是否存在,不存在则造一个
            List <int> condiList;

            if (!paramCondi.TryGetValue(nParam, out condiList))
            {
                condiList          = new List <int>();
                paramCondi[nParam] = condiList;
            }
            //添加数据
            condiList.Add(nConditionId);
        }
Ejemplo n.º 12
0
 public uint getSingleBits(eEventType et)
 {
     uint[] res = bits.lookup(et);
     if (res.isEmpty())
     {
         return(0);
     }
     Debug.Assert(1 == res.Length);
     return(res[0]);
 }
Ejemplo n.º 13
0
        public void RemoveEvent <T, U>(eEventType eType, EventCallback <T, U> handler)
        {
            CheckRemoveEvent(eType, handler);

            _eventTable[eType] = (EventCallback <T, U>)_eventTable[eType] - handler;
            if (_eventTable[eType] == null)
            {
                _eventTable.Remove(eType);
            }
        }
Ejemplo n.º 14
0
        public void RegisterEvent <T, U>(eEventType eType, EventCallback <T, U> handler)
        {
            if (!_eventTable.ContainsKey(eType))
            {
                _eventTable.Add(eType, null);
            }

            CheckRegisterEvent(eType, handler);

            _eventTable[eType] = (EventCallback <T, U>)_eventTable[eType] + handler;
        }
Ejemplo n.º 15
0
    static void OnListenerAdding(eEventType eventType, Delegate callBack)
    {
        if (!m_EventTable.ContainsKey(eventType))
        {
            m_EventTable.Add(eventType, null);
        }
        Delegate d = m_EventTable[eventType];

        if (d != null && d.GetType() != callBack.GetType())
        {
            throw new Exception(string.Format("尝试为事件{0}添加不同类型的委托,当前事件对应的的委托是{1},要添加的委托类型是{2}", eventType, d.GetType(), callBack));
        }
    }
Ejemplo n.º 16
0
    public static void Invoke(eEventType type, eEventMessage msg, params object[] obj)
    {
        IsInvoking = true;
        var e = logicEventSet.GetEnumerator();

        while (e.MoveNext())
        {
            if (e.Current.Type.HasFlag(type))
            {
                e.Current.Event.OnInvoked(msg, obj);
            }
        }
        IsInvoking = false;
    }
Ejemplo n.º 17
0
        //public delegate void EventCallback<T, U, V>( T arg1, U arg2, V arg3 );

        private void CheckRegisterEvent(eEventType eType, Delegate handler)
        {
            if (!_eventTable.ContainsKey(eType))
            {
                return;
            }

            Delegate d = _eventTable[eType];

            if (d != null && d.GetType( ) != handler.GetType( ))
            {
                throw new EventDispatcherException(string.Format("注册一个消息事件出错,类型:{0},原类型:{1},新增类型:{2}", eType,
                                                                 d.GetType( ).Name, handler.GetType( ).Name));
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Reads the DST dates from the meter from Table 2260
        /// </summary>
        /// <returns>The TOU Schedule object.</returns>
        // Revision History
        // MM/DD/YY who Version Issue#  Description
        // -------- --- ------- ------  ---------------------------------------
        // 11/20/10 SCW         N/Q	    Created
        // 11/30/10 jrf 9.70.11         Offseting DST month and day by 1.
        private List <CDSTDatePair> ReadDSTDates()
        {
            if (m_DSTCalendar == null)
            {
                m_DSTCalendar = new CENTRON2_MONO_DSTCalendarConfig(m_PSEM);
            }

            List <CDSTDatePair> lstDSTDates = new List <CDSTDatePair>();

            for (int iYearCounter = 0; iYearCounter < m_DSTCalendar.MaxYears; iYearCounter++)
            {
                CalendarEvent[] CalEvents = m_DSTCalendar.Years[iYearCounter].Events;
                int             iYear     = 2000 + (int)m_DSTCalendar.Years[iYearCounter].Year;

                CDSTDatePair DST = new CDSTDatePair();
                // Index 0 and Index 1 are the To and From DST Date respectively
                for (int iDayEvent = 0; iDayEvent < m_DSTCalendar.EventsPerYear; iDayEvent++)
                {
                    eEventType eType = m_DSTCalendar.GetEventType(CalEvents[iDayEvent].Type);
                    if (eEventType.TO_DST == eType)
                    {
                        // It is a valid event
                        // Month and day are zero based so we are adding one.
                        DST.ToDate = new DateTime(iYear, CalEvents[iDayEvent].Month + 1,
                                                  CalEvents[iDayEvent].Day + 1, m_DSTCalendar.DSTHour, m_DSTCalendar.DSTMinute, 0);
                    }
                    else if (eEventType.FROM_DST == eType)
                    {
                        // It is a valid event
                        // Month and day are zero based so we are adding one.
                        DST.FromDate = new DateTime(iYear, CalEvents[iDayEvent].Month + 1,
                                                    CalEvents[iDayEvent].Day + 1, m_DSTCalendar.DSTHour, m_DSTCalendar.DSTMinute, 0);
                    }
                }

                lstDSTDates.Add(DST);

                // It may be possible that some of the years are not filled in so we need to
                // make sure that the year is valid by checking to see if the next year is
                // greater than the current
                if (iYearCounter + 1 < m_DSTCalendar.MaxYears && (int)m_DSTCalendar.Years[iYearCounter + 1].Year + 2000 < iYear)
                {
                    break;
                }
            }
            return(lstDSTDates);
        }
Ejemplo n.º 19
0
    /// <summary>
    /// 广播1参方法
    /// </summary>
    /// <param name="eventType"></param>
    public static void Broadcast <T>(eEventType eventType, T arg)
    {
        Delegate d;

        if (m_EventTable.TryGetValue(eventType, out d))
        {
            CallBack <T> callBack = d as CallBack <T>;
            if (callBack != null)
            {
                callBack(arg);
            }
            else
            {
                throw new Exception(string.Format("广播事件错误:事件{0}对应的委托具有不同类型", eventType));
            }
        }
    }
Ejemplo n.º 20
0
    public static void Broadcast <T, X, Y, Z, W>(eEventType eventType, T arg1, X arg2, Y arg3, Z arg4, W arg5)
    {
        Delegate d;

        if (m_EventTable.TryGetValue(eventType, out d))
        {
            CallBack <T, X, Y, Z, W> callBack = d as CallBack <T, X, Y, Z, W>;
            if (callBack != null)
            {
                callBack(arg1, arg2, arg3, arg4, arg5);
            }
            else
            {
                throw new Exception(string.Format("广播事件错误:事件{0}对应的委托具有不同类型", eventType));
            }
        }
    }
Ejemplo n.º 21
0
        void iRawInputSink.handle(ulong timestamp, eEventType eventType, ushort code, int value)
        {
            try
            {
                nativeTimeStamp = timestamp;

                switch (eventType)
                {
                case eEventType.Synchro:
                    handleSyncro((eSynchroEvent)(code & 0xFF));
                    return;

                case eEventType.Key:
                    handleKeyOrButton(code, value);
                    return;

                case eEventType.Relative:
                    handleRelative((eRelativeAxis)code, value);
                    return;

                case eEventType.Absolute:
                    handleAbsolute((eAbsoluteAxis)(code & 0xFF), value);
                    return;

                case eEventType.Miscellaneous:
                    handleMiscellaneous((eMiscEvent)(code & 0xFF), value);
                    return;

                case eEventType.Switch:
                    handleSwitch((eSwitch)(code & 0xFF), value);
                    return;

                case eEventType.LED:
                    handleLed((eLed)(code & 0xFF), value);
                    return;
                }
            }
            catch (Exception ex)
            {
                // ComLight runtime marshals exceptions into failed HRESULT codes, in this case it would cause the app to shut down the dispatcher and quit.
                // Hopefully, an exception in user input handler is not a good reason to shut down.
                ex.logError("RawDeviceBase.iRawInputSink failed");
                ConsoleLogger.logDebug("Moar info: {0}", ex.ToString());
            }
        }
Ejemplo n.º 22
0
        private void CheckRemoveEvent(eEventType eType, Delegate handler)
        {
            if (!_eventTable.ContainsKey(eType))
            {
                throw new EventDispatcherException(string.Format("删除一个消息事件出错,类型:{0},没找到该消息", eType));
            }

            Delegate d = _eventTable[eType];

            if (d == null)
            {
                throw new EventDispatcherException(string.Format("删除一个消息事件出错,类型:{0},没找到该消息", eType));
            }
            else if (d.GetType( ) != handler.GetType( ))
            {
                throw new EventDispatcherException(string.Format("删除一个消息事件出错,类型:{0},原类型:{1},删除类型:{2}", eType,
                                                                 d.GetType( ).Name, handler.GetType( ).Name));
            }
        }
Ejemplo n.º 23
0
 static void OnListenerRemoving(eEventType eventType, Delegate callBack)
 {
     if (m_EventTable.ContainsKey(eventType))
     {
         Delegate d = m_EventTable[eventType];
         if (d == null)
         {
             throw new Exception(string.Format("移除监听错误:事件{0}没有对应的委托", eventType));
         }
         else if (d.GetType() != callBack.GetType())
         {
             throw new Exception(string.Format("移除监听错误:尝试为事件{0}移除不同类型的委托,当前委托类型为{1}" +
                                               ",要移除的委托的类型为{2}", eventType, d.GetType(), callBack.GetType()));
         }
     }
     else
     {
         throw new Exception(string.Format("移除监听错误:没有事件码{0}", eventType));
     }
 }
Ejemplo n.º 24
0
        public EventSubscription(VideoDevice videoDevice)
        {
            device = videoDevice.file;

            eEventType[] eventTypes = new eEventType[]
            {
                eEventType.EndOfStream,
                eEventType.SourceChange,
            };

            foreach (var e in eventTypes)
            {
                // Subscribe for the events
                sEventSubscription evt = new sEventSubscription()
                {
                    type = e
                };
                device.call(eControlCode.SUBSCRIBE_EVENT, ref evt);
            }
        }
Ejemplo n.º 25
0
    public static GameEvent FromObject(JsonData jsonObject)
    {
        GameEvent  gameEvent      = null;
        eEventType gameEventType  = (eEventType)((int)jsonObject["event_type"]);
        Type       gameEventClass = GameEvent.GetEventClassForType(gameEventType);

        if (gameEventClass != null)
        {
            long epochTicks = JsonUtilities.ParseLong(jsonObject, "timestamp") + UNIX_EPOCH.Ticks;

            gameEvent = (GameEvent)Activator.CreateInstance(gameEventClass);

            gameEvent.EventType = gameEventType;
            gameEvent.Timestamp = new DateTime(epochTicks);

            // Parse the child event fields based on type
            gameEvent.ParseParameters(jsonObject["parameters"] as JsonData);
        }

        return(gameEvent);
    }
Ejemplo n.º 26
0
 private void ExecuteEvent(eEventType eventType)
 {
     if (enabled)
     {
         int conversationIndex = m_events[(int)eventType];
         if (conversationController && !conversationController.IsPlayingDialog && m_activeEvents.Contains(eventType))
         {
             UnityAction onCloseAction = null;
             if (onCloseEvent != null)
             {
                 onCloseAction = () => onCloseEvent.Invoke();
             }
             if (conversationIndex < 0)
             {
                 conversationController.StartConversation(onCloseAction);
             }
             else
             {
                 conversationController.StartConversation(conversationIndex, onCloseAction);
             }
         }
     }
 }
Ejemplo n.º 27
0
        /// <summary>
        /// Reads the TOU Schedule from the meter into a TOUSchedule object
        /// </summary>
        /// <returns>The TOU Schedule object.</returns>
        // Revision History
        // MM/DD/YY who Version Issue#  Description
        // -------- --- ------- ------  ---------------------------------------
        // 01/04/07 RCG 8.00.04		    Made more generic and promoted from CENTRON_AMI
        // 04/13/07 RCG 8.00.31 2919    Adding support for Output events.
        // 03/10/08 KRC 1.50.02         Adding Ability to create TOU Schedule from EDL file
        //  12/03/10 DEO 9.70.13        Promoted from ANSIDevice

        public static CTOUSchedule ReadCENTRON2TOUSchedule(TOUConfig TOUConfigTable, CalendarConfig CalendarConfigTable)
        {
            Int16Collection NormalDays;
            Int16Collection HolidayDays;
            ANSITOUSchedule TOUSchedule = new ANSITOUSchedule();

            TOUConfig.TOU_Season CurrentSeason;
            int iNextEventCounter = 0;
            int iPatternID        = 0;

            try
            {
                // First set up the typical week so that we know which day corresponds to which daytype
                if (TOUConfigTable.NumberOfSupportedSeasons > 0)
                {
                    CurrentSeason = TOUConfigTable.Seasons[0];

                    // We have to assume that the Typical week is that same for all seasons. NOTE: The Day to Daytype is 1 based
                    // so we need to subtract 1
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.SUNDAY]    = TOUSchedule.NormalDays[CurrentSeason.TypicalSunday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.MONDAY]    = TOUSchedule.NormalDays[CurrentSeason.TypicalMonday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.TUESDAY]   = TOUSchedule.NormalDays[CurrentSeason.TypicalTuesday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.WEDNESDAY] = TOUSchedule.NormalDays[CurrentSeason.TypicalWednesday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.THURSDAY]  = TOUSchedule.NormalDays[CurrentSeason.TypicalThursday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.FRIDAY]    = TOUSchedule.NormalDays[CurrentSeason.TypicalFriday];
                    TOUSchedule.TypicalWeek[(int)eTypicalDay.SATURDAY]  = TOUSchedule.NormalDays[CurrentSeason.TypicalSaturday];
                }

                for (int iSeasonCounter = 0; iSeasonCounter < TOUConfigTable.NumberOfSupportedSeasons; iSeasonCounter++)
                {
                    // Get the Season that we are dealing with.
                    CurrentSeason = TOUConfigTable.Seasons[iSeasonCounter];
                    NormalDays    = new Int16Collection();
                    HolidayDays   = new Int16Collection();

                    for (int iDayTypeCounter = 0; iDayTypeCounter < TOUConfigTable.DayTypesPerSeason; iDayTypeCounter++)
                    {
                        CSwitchPointCollection SPColl = new CSwitchPointCollection();
                        for (int iEventCounter = 0; iEventCounter < TOUConfigTable.EventsPerDayType; iEventCounter++)
                        {
                            // Get the Day Event
                            TOUConfig.DayEvent DayEvent = CurrentSeason.TimeOfDayEvents[iDayTypeCounter, iEventCounter];
                            ushort             usEvent  = DayEvent.Event;
                            if (usEvent != (ushort)TOUConfig.DayEvent.TOUEvent.NoMoreChanges)
                            {
                                if (IsRateChangeEvent(usEvent) == true)
                                {
                                    // We have a valid Event, so proceed with createing a SwitchPoint
                                    int iHour      = (int)DayEvent.Hour;
                                    int iMinute    = (int)DayEvent.Minute;
                                    int iStartTime = (iHour * 60) + iMinute;
                                    int iEndTime   = 24 * 60;

                                    iNextEventCounter = iEventCounter + 1;

                                    while (iNextEventCounter < TOUConfigTable.EventsPerDayType)
                                    {
                                        TOUConfig.DayEvent NextDayEvent = CurrentSeason.TimeOfDayEvents[iDayTypeCounter, iNextEventCounter];

                                        if (IsRateChangeEvent(NextDayEvent.Event) == true)
                                        {
                                            iHour    = (int)NextDayEvent.Hour;
                                            iMinute  = (int)NextDayEvent.Minute;
                                            iEndTime = (iHour * 60) + iMinute;

                                            // We need to stop looking once we find the next rate change event.
                                            break;
                                        }

                                        iNextEventCounter++;
                                    }

                                    // Add the rate change event
                                    int iRateIndex = GetRateIndex(usEvent);
                                    // Finally figure out the Switchpoint type
                                    CSwitchPoint SchedSwitchPoint = new CSwitchPoint(iStartTime, iEndTime,
                                                                                     iRateIndex, eSwitchPointType.RATE);

                                    SPColl.Add(SchedSwitchPoint);
                                }
                                else if (IsOutputOnEvent(usEvent) == true)
                                {
                                    // We have a valid output on Event, so proceed with createing a SwitchPoint
                                    int iHour      = (int)DayEvent.Hour;
                                    int iMinute    = (int)DayEvent.Minute;
                                    int iStartTime = (iHour * 60) + iMinute;
                                    int iEndTime   = 24 * 60;

                                    int iOutputIndex = GetOutputIndex(usEvent);

                                    // Find the OutputOff event for this rate if one exists
                                    iNextEventCounter = iEventCounter + 1;

                                    while (iNextEventCounter < TOUConfigTable.EventsPerDayType)
                                    {
                                        TOUConfig.DayEvent NextDayEvent = CurrentSeason.TimeOfDayEvents[iDayTypeCounter, iNextEventCounter];

                                        if (IsOutputOffEvent(NextDayEvent.Event) == true)
                                        {
                                            // Check to see if the index matches
                                            if (iOutputIndex == GetOutputIndex(NextDayEvent.Event))
                                            {
                                                iHour    = (int)NextDayEvent.Hour;
                                                iMinute  = (int)NextDayEvent.Minute;
                                                iEndTime = (iHour * 60) + iMinute;

                                                // We need to stop looking once we find the next rate change event.
                                                break;
                                            }
                                        }

                                        iNextEventCounter++;
                                    }

                                    // Finally figure out the Switchpoint type
                                    CSwitchPoint SchedSwitchPoint = new CSwitchPoint(iStartTime, iEndTime,
                                                                                     iOutputIndex, eSwitchPointType.OUTPUT);

                                    SPColl.Add(SchedSwitchPoint);
                                }

                                // We do not need to handle the OutputOff event since they get handled by the OutputOn check
                            }
                        }

                        // Since we have no way of knowing whether the the patterns for the current season are related
                        // to the patterns in other seasons we need to add the patterns regardless of whether or not it
                        // has already been duplicated in another season

                        // To keep the patterns unique we need to add in an offset for the season number

                        iPatternID = iDayTypeCounter + iSeasonCounter * TOUConfigTable.DayTypesPerSeason;

                        CPattern SchedPattern = new CPattern(iPatternID, "Pattern " + iDayTypeCounter.ToString(CultureInfo.InvariantCulture),
                                                             SPColl);

                        NormalDays.Add((short)iPatternID);

                        // The Day to Daytype conversions are 1's based so subract 1
                        if (iDayTypeCounter == CurrentSeason.TypicalHoliday)
                        {
                            // This Day Type is a holiday
                            HolidayDays.Add((short)iPatternID);
                        }

                        TOUSchedule.Patterns.Add(SchedPattern);
                    }

                    // Add the season to the schedule
                    CSeason SchedSeason = new CSeason(iSeasonCounter + 1, "Season " + (iSeasonCounter + 1).ToString(CultureInfo.InvariantCulture), NormalDays, HolidayDays);

                    TOUSchedule.Seasons.Add(SchedSeason);
                }

                // Now deal with the Calendar part of the config
                TOUSchedule.TOUID = CalendarConfigTable.CalendarID;

                for (int iYearCounter = 0; iYearCounter < CalendarConfigTable.MaxYears; iYearCounter++)
                {
                    CEventCollection EventColl = new CEventCollection();
                    CalendarEvent[]  CalEvents =
                        CalendarConfigTable.Years[iYearCounter].Events;
                    int iYear = 2000 + (int)CalendarConfigTable.Years[iYearCounter].Year;

                    // Start at Index 2, which is the first non-DST Event
                    for (int iDayEvent = CalendarConfigTable.DSTEventsPerYear;
                         iDayEvent < CalendarConfigTable.EventsPerYear; iDayEvent++)
                    {
                        eEventType eType       = CalendarConfigTable.GetEventType(CalEvents[iDayEvent].Type);
                        int        iEventIndex = iDayEvent;

                        if (eEventType.NO_EVENT != eType)
                        {
                            // It is a valid event
                            DateTime dtDate = new DateTime(iYear, CalEvents[iDayEvent].Month + 1,
                                                           CalEvents[iDayEvent].Day + 1);

                            // Determine the index for the event
                            if (eType == eEventType.SEASON)
                            {
                                iEventIndex = CalEvents[iDayEvent].Type - (int)CalendarEvent.CalendarEventType.SEASON1 - 1;
                            }
                            else if (eType == eEventType.HOLIDAY)
                            {
                                // Determine which Holiday day type to use
                                // Currently the ANSI devices only support 1 holiday day type so this is always 0
                                iEventIndex = 0;
                            }

                            CEvent Event = new CEvent(dtDate, eType,
                                                      iEventIndex, "Event " + iDayEvent.ToString(CultureInfo.InvariantCulture));

                            EventColl.Add(Event);
                        }
                    }
                    CYear Year = new CYear(iYear, EventColl);

                    TOUSchedule.Years.Add(Year);

                    // It may be possible that some of the years are not filled in so we need to
                    // make sure that the year is valid by checking to see if the next year is
                    // greater than the current
                    if (iYearCounter + 1 < CalendarConfigTable.MaxYears &&
                        (int)CalendarConfigTable.Years[iYearCounter + 1].Year + 2000 < iYear)
                    {
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                throw (e);
            }

            return(TOUSchedule);
        }
Ejemplo n.º 28
0
 public AutomateEventArgs(eEventType EventType, object Object)
 {
     this.EventType = EventType;
     this.Object    = Object;
 }
Ejemplo n.º 29
0
 //TODO: create event per type!????????????? so can listen to specific events
 public GingerRunnerEventArgs(eEventType EventType, object Object)
 {
     this.EventType = EventType;
     this.Object    = Object;
 }
Ejemplo n.º 30
0
 public bool IsUsingEvent(eEventType eventType)
 {
     return(m_activeEvents.Contains(eventType));
 }
Ejemplo n.º 31
0
 public WidgetEvent(eEventType eventType, IWidget eventSource, object eventParameters)
 {
     EventType = eventType;
     EventSource = eventSource;
     EventParameters = eventParameters;
 }
Ejemplo n.º 32
0
    private static Type GetEventClassForType(eEventType eventType)
    {
        Type eventClass = null;

        switch(eventType)
        {
        case eEventType.character_joined_game:
            eventClass = typeof(GameEvent_CharacterJoinedGame);
            break;
        case eEventType.character_left_game:
            eventClass = typeof(GameEvent_CharacterLeftGame);
            break;
        case eEventType.character_died:
            eventClass = typeof(GameEvent_CharacterDied);
            break;
        case eEventType.character_moved:
            eventClass = typeof(GameEvent_CharacterMoved);
            break;
        case eEventType.character_portaled:
            eventClass = typeof(GameEvent_CharacterPortaled);
            break;
        case eEventType.character_attacked:
            eventClass = typeof(GameEvent_CharacterAttacked);
            break;
        case eEventType.mob_spawned:
            eventClass = typeof(GameEvent_MobSpawned);
            break;
        case eEventType.mob_died:
            eventClass = typeof(GameEvent_MobDied);
            break;
        case eEventType.mob_moved:
            eventClass = typeof(GameEvent_MobMoved);
            break;
        case eEventType.mob_attacked:
            eventClass = typeof(GameEvent_MobAttacked);
            break;
        case eEventType.mob_dialog:
            eventClass = typeof(GameEvent_MobDialog);
            break;
        case eEventType.mob_player_prop_spotted:
            eventClass = typeof(GameEvent_MobPlayerPropSpotted);
            break;
        case eEventType.mob_player_prop_lost_track:
            eventClass = typeof(GameEvent_MobPlayerPropLostTrack);
            break;
        case eEventType.mob_ai_prop_spotted:
            eventClass = typeof(GameEvent_MobAIPropSpotted);
            break;
        case eEventType.mob_energy_tank_prop_spotted:
            eventClass = typeof(GameEvent_MobEnergyTankPropSpotted);
            break;
        case eEventType.energy_tank_drained:
            eventClass = typeof(GameEvent_EnergyTankDrained);
            break;
        case eEventType.energy_tank_hacked:
            eventClass = typeof(GameEvent_EnergyTankHacked);
            break;
        case eEventType.character_updated:
            eventClass = typeof(GameEvent_CharacterUpdated);
            break;
        }

        return eventClass;
    }