This project is read-only.


May 27, 2013 at 1:04 AM
heya all, i'm kinda new, do you have an example on how to setup a project with this
in visual studio with maybe an example on how to get the event list into a List<> type? or something
May 27, 2013 at 2:21 AM
Hiya, please excuse the mess. This is still a very young project and things are still changing very rapidly.

You should be able to download the project as-is and add it to your own solution as a second project. Then just add a reference to this project from your own project in the same solution.

You should use the V1 namespace. The other classes are deprecated and will be removed soon. Everything in V1 hangs off the WorldManager class, so you just instantiate that class and then use its various properties and methods like so:
GW2DotNET.V1.World.WorldManager wm = new GW2DotNET.V1.World.WorldManager();
The worlds and maps list can be accessed 3 ways. You can either get the whole list, or retrieve one by name or ID:
var allMaps = wm.Maps;
var oneMapFromString = wm.["Queensdale"];
var oneMapFromId = wm.[1234];  // Not sure if that's a valid ID, just made it up
Same thing for worlds:
var allWorlds = wm.Worlds;
var oneWorldFromString = wm.Worlds["Tarnished Coast'];
var oneWorldFromId = wm.Worlds[1017];
Note that Maps and Worlds are all cached for the lifetime of the WorldManager object, because they do not change.

Events are retrieved via methods rather than properties, and are not cached:
var allEventsForAllWorlds = wm.Events.GetAllEvents();  // This returns over 70,000 objects!
var eventsForOneWorld = wm.Events.GetEvents(oneWorldFromString);  // we pass in the World object we retrieved earlier
var jormagEventId = new Guid("0464CB9E-1848-4AAA-BA31-4779A959DD71");
var oneEvent = wm.Events.GetEvent(oneWorldFromString.Id, jormagEventId);
You can see the calls are a little inconsistent right now. GetEvents takes a World while GetEvent just wants the world's ID. Like I said, everything is still in flux.

Hopefully that's all fairly clear. Let us know if you have further questions.
May 27, 2013 at 11:41 AM
I also might add that the maps and world implementations are probably staying as they are now, but most likely something will change in the Event retrieval process. I cannot say for sure as I need to do some testing with UI. Still I'm going to write some documentation today.
May 28, 2013 at 9:19 PM
Kool that explains alot.
I will play with it more tongiht, see if i cant get something going with it really simple.
Appreciate the work.