public Stream GetPartyIcon(PartyIconColor partyIconColor) { if (PartyIcons.ContainsKey(partyIconColor)) { return(HeroesIconsAssembly.GetManifestResourceStream(PartyIcons[partyIconColor])); } return(null); }
public static Dictionary <int, PartyIconColor> FindPlayerParties(ICollection <ReplayMatchPlayer> playersList) { Dictionary <long, List <int> > parties = new Dictionary <long, List <int> >(); foreach (var player in playersList) { if (player.PartyValue != 0) { if (!parties.ContainsKey(player.PartyValue)) { var listOfMembers = new List <int> { player.PlayerNumber, }; parties.Add(player.PartyValue, listOfMembers); } else { var listOfMembers = parties[player.PartyValue]; listOfMembers.Add(player.PlayerNumber); parties[player.PartyValue] = listOfMembers; } } } var playerPartyIcons = new Dictionary <int, PartyIconColor>(); PartyIconColor color = 0; foreach (var party in parties) { foreach (int playerNum in party.Value) { playerPartyIcons.Add(playerNum, color); } color++; } return(playerPartyIcons); }
public BitmapImage GetPartyIcon(PartyIconColor partyIconColor) { if (PartyIcons.ContainsKey(partyIconColor)) { try { BitmapImage image = new BitmapImage(PartyIcons[partyIconColor]); image.Freeze(); return(image); } catch (IOException) { LogMissingImage($"Missing image: {PartyIcons[partyIconColor]}"); return(null); } } else { LogReferenceNameNotFound($"Other Icons: {partyIconColor}"); return(null); } }
private void SetPartyIcon(PartyIconColor icon) { PartyIcon = ImageStreams.PartyIconImage(icon); }
private void SetPartyIcon(PartyIconColor icon) { PartyIcon = HeroesIcons.GetPartyIcon(icon); }