GW2PAO.API.Services.EventsService.GetState C# (CSharp) Méthode

GetState() public méthode

Retrieves the current state of the given event
public GetState ( System.Guid id ) : Data.Enums.EventState
id System.Guid The ID of the event to retrieve the state of
Résultat Data.Enums.EventState
        public Data.Enums.EventState GetState(Guid id)
        {
            if (this.WorldBossEventTimeTable.WorldEvents.Any(evt => evt.ID == id))
            {
                WorldBossEvent worldEvent = this.WorldBossEventTimeTable.WorldEvents.First(evt => evt.ID == id);
                return this.GetState(worldEvent);
            }
            else
            {
                return Data.Enums.EventState.Unknown;
            }
        }

Same methods

EventsService::GetState ( WorldBossEvent evt ) : Data.Enums.EventState

Usage Example

        public void EventsService_GetState_WorldEvent_Blank_Inactive()
        {
            EventsService es = new EventsService();
            es.LoadTables(false);

            var sw = new Stopwatch();
            sw.Start();
            var state = es.GetState(new WorldBossEvent());
            sw.Stop();
            Console.WriteLine("{0}ms", sw.ElapsedMilliseconds);

            Assert.AreEqual(EventState.Inactive, state);
        }
All Usage Examples Of GW2PAO.API.Services.EventsService::GetState