This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
Usage
roncli edited this page Nov 12, 2014
·
2 revisions
The following document will describe basic usage of the library. It is recommended that you look at the demo project in the source file for a more detailed look at how LibWowAPI operates. There is also help documentation available which fully documents that API.
Be sure to include a reference to LibWowAPI in your class with the following declaration:
using roncliProductions.LibWowAPI;
Imports roncliProductions.LibWowAPI
There are several shared properties that you can set prior to using the library:
// For Mashery API authentication
WowAPIData.ApiKey = "ABCDEFGHIJKL";
// Supporting all regions and languages currently supported by the API
WowAPIData.Region = Internationalization.Region.NorthAmerica;
WowAPIData.Language = Internationalization.Language.EnglishUS;
// Identify your application to Blizzard
WowAPIData.Application = "My LibWowAPI Application";
WowAPIData.ApplicationURL = "http://www.mywowsite.com";
' For Mashery API authentication
WowAPIData.ApiKey = "ABCDEFGHIJKL"
' Supporting all regions and languages currently supported by the API
WowAPIData.Region = Internationalization.Region.NorthAmerica
WowAPIData.Language = Internationalization.Language.EnglishUS
' Identify your application to Blizzard
WowAPIData.Application = "My LibWowAPI Application"
WowAPIData.ApplicationURL = "http://www.mywowsite.com"
To use the library, first you instantiate an instance of the class you want to use.
Character cCharacter = new Character.CharacterProfile();
Dim cCharacter As New Character.CharacterProfile()
Next, you set options you want to use.
cCharacter.Options.Realm = "Lightbringer";
cCharacter.Options.Name = "Roncli";
cCharacter.Options.Items = true;
cCharacter.Options.Talents = true;
cCharacter.Options.Progression = true;
cCharacter.Options.Realm = "Lightbringer"
cCharacter.Options.Name = "Roncli"
cCharacter.Options.Items = True
cCharacter.Options.Talents = True
cCharacter.Options.Progression = True
Then, you load the data from the API.
cCharacter.Load();
cCharacter.Load()
Finally, you retrieve the information from the object.
int intAchievementPoints = cCharacter.Character.AchievementPoints;
Character.Item iHeadItem = cCharacter.Character.Items.Head;
Dim intAchievementPoints As Integer = cCharacter.Character.AchievementPoints
Dim iHeadItem as Character.Item = cCharacter.Character.Items.Head
Some properties are made of collections, which allows for using LINQ.
var varSelectedTalents = (from t in cCharacter.Talents where t.Selected select t);
var varClearedHeroicRaids = (from r in cCharacter.Progression.Raids where r.Heroic == Progress.Cleared select r);
Dim varSelectedTalents = (From t in cCharacter.Talents Where t.Selected)
Dim varClearedHeroicRaids = (From r in cCharacter.Progression.Raids Where r.Heroic = Progress.Cleared)