Created
April 5, 2018 18:17
-
-
Save Daniel-sims/182115ded3c85187eaa0a6f521a53f78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ICollection<Models.DbMatch.PlayerItem> GetItemsForParticipant(RiotSharp.Endpoints.MatchEndpoint.Participant participant) | |
{ | |
ICollection<Models.DbMatch.PlayerItem> items = new List<Models.DbMatch.PlayerItem>(); | |
try | |
{ | |
if (participant?.Stats?.Item0 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item0, ItemSlot = 0}); | |
} | |
if (participant?.Stats.Item1 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item1, ItemSlot = 1 }); | |
} | |
if (participant?.Stats?.Item2 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item2, ItemSlot = 2 }); | |
} | |
if (participant?.Stats?.Item3 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item3, ItemSlot = 3 }); | |
} | |
if (participant?.Stats?.Item4 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item4, ItemSlot = 4 }); | |
} | |
if (participant?.Stats?.Item5 != 0) | |
{ | |
items.Add(new Models.DbMatch.PlayerItem() { ItemId = participant.Stats.Item5, ItemSlot = 5 }); | |
} | |
} | |
catch(Exception ex) | |
{ | |
_logging.LogEvent(" Exception hit when getting items for participant : " + ex.Message); | |
} | |
return items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment