Example #1
0
 /// <summary>
 /// Translates <paramref name="GDCard"/> into Models.Grimoire.Card
 /// </summary>
 /// <param name="GDCard">BungieNetAPI Card to be translated</param>
 /// <param name="SearchForPoints">True to include points, False will set points to 0. <see cref="Points(int)"/></param>
 /// <returns>Filled Translated Model of the Grimoire Card</returns>
 public static Models.Grimoire.Card Card(GrimoireDefinition.CardStruct GDCard, bool SearchForPoints = true)
 {
     return new Models.Grimoire.Card()
     {
         Name = GDCard.cardName,
         Intro = GDCard.cardIntro,
         Description = GDCard.cardDescription,
         Image = _ImageBasePath + GDCard.highResolution.image.sheetPath,
         Points = SearchForPoints ? Points(GDCard.cardId) : 0,
         BonusName = GDCard.bonusName,
         BonusDescription = GDCard.bonusDescription
     };
 }
Example #2
0
 /// <summary>
 /// Translates <paramref name="GDPage"/> into Models.Grimoire.Page
 /// </summary>
 /// <param name="GDPage">BungieNetAPI Page to be translated</param>
 /// <returns>Filled Translated Model of the Grimoire Page</returns>
 public static Models.Grimoire.Page Page(GrimoireDefinition.PageStruct GDPage)
 {
     Models.Grimoire.Page page = new Models.Grimoire.Page();
     page.Name = GDPage.pageName;
     page.Image = _ImageBasePath + GDPage.highResolution.image.sheetPath;
     for (int i = 0; i < GDPage.cardCollection.Length; i++)
     {
         GrimoireDefinition.CardStruct GDCard = GDPage.cardCollection[i];
         Models.Grimoire.Card card = Card(GDCard, false);
         card.Points = GDPage.cardBriefs[i].totalPoints;
         page.CardCollection.Add(card);
     }
     return page;
 }
Example #3
0
 /// <summary>
 /// Translates <paramref name="GDTheme"/> into Models.Grimoire.Theme
 /// </summary>
 /// <param name="GDTheme">BungieNetAPI Theme to be translated</param>
 /// <returns>Filled Translated Model of the Grimoire Theme</returns>
 public static Models.Grimoire.Theme Theme(GrimoireDefinition.ThemeStruct GDTheme)
 {
     Models.Grimoire.Theme theme = new Models.Grimoire.Theme();
     theme.Name = GDTheme.themeName;
     theme.Image = _ImageBasePath + GDTheme.highResolution.image.sheetPath;
     foreach (GrimoireDefinition.PageStruct GDPage in GDTheme.pageCollection)
     {
         theme.PageCollection.Add(Page(GDPage));
     }
     return theme;
 }