This repository was archived by the owner on Jan 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Dynamic Events
Ruhrpottpatriot edited this page Sep 1, 2015
·
1 revision
using GW2NET;
var service = GW2.V1.EventNames.ForDefaultCulture();
var dynamicEvents = service.FindAll();
foreach (var dynamicEvent in dynamicEvents.Values)
{
Console.WriteLine("Event ID: {0}", dynamicEvent.EventId);
Console.WriteLine("Event Name: {0}", dynamicEvent.Name);
}
using GW2NET;
using GW2NET.DynamicEvents;
var service = GW2.V1.Events.ForDefaultCulture();
var dynamicEvents = service.FindAll();
foreach (var dynamicEvent in dynamicEvents.Values)
{
Console.WriteLine("Event ID: {0}", dynamicEvent.EventId);
Console.WriteLine("Event Name: {0}", dynamicEvent.Name);
Console.WriteLine("Event Level: {0}", dynamicEvent.Level);
Console.WriteLine("Event Map ID: {0}", dynamicEvent.MapId);
Console.WriteLine("Event Flags: {0}", dynamicEvent.Flags);
Console.WriteLine("Event Location Center: {0}", dynamicEvent.Location.Center);
if (dynamicEvent.Location is SphereLocation)
{
var sphereLocation = (SphereLocation)dynamicEvent.Location;
Console.WriteLine("Event Location Radius: {0}", sphereLocation.Radius);
Console.WriteLine("Event Location Rotation: {0}", sphereLocation.Rotation);
}
else if (dynamicEvent.Location is CylinderLocation)
{
var cylinderLocation = (CylinderLocation)dynamicEvent.Location;
Console.WriteLine("Event Location Height: {0}", cylinderLocation.Height);
Console.WriteLine("Event Location Radius: {0}", cylinderLocation.Radius);
Console.WriteLine("Event Location Rotation: {0}", cylinderLocation.Rotation);
}
else if (dynamicEvent.Location is PolygonLocation)
{
var polygonLocation = (PolygonLocation)dynamicEvent.Location;
Console.WriteLine("Event Location Z-Range: {0}", polygonLocation.ZRange);
Console.WriteLine("Event Location Points: {0}", polygonLocation.Points);
}
}
using GW2NET;
var service = GW2.Local.EventRotations;
var rotations = service.GetDynamicEventRotations();
foreach (var rotation in rotations.Values)
{
Console.WriteLine(rotation.EventId);
foreach (var shift in rotation.Shifts)
{
Console.WriteLine("{0,20}", shift.LocalDateTime.TimeOfDay);
}
}
using GW2NET;
var service = GW2.Local.EventRotations;
var rotations = service.GetDynamicEventRotations();
var rotationsByStartTime = from rotation in rotations.Values
from shift in rotation.Shifts
group rotation by shift into rotationsByShift
orderby rotationsByShift.Key.LocalDateTime
select rotationsByShift;
foreach (var rotation in rotationsByStartTime)
{
Console.WriteLine(rotation.Key.LocalDateTime.TimeOfDay);
foreach (var dynamicEvent in rotation)
{
Console.WriteLine("{0,40}", dynamicEvent.EventId);
}
}
-
Documentation
-
Specialty Services
-
Optional Topics