Beispiel #1
0
        public MatchesBase(IInternalService internalService, IWebsiteService website, IMatchesTabService matchesTab, GameMode matchGameMode, MatchesTab currentTab)
            : base(internalService)
        {
            Website           = website;
            MatchesTabService = matchesTab;
            MatchGameMode     = matchGameMode;
            CurrentTab        = currentTab;

            ShowMatchSummaryButtonEnabled = true;

            SeasonList.Add("Lifetime");
            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeasonOption = SeasonList[0];

            GameTimeList           = HeroesHelpers.GameDates.GameTimeList;
            SelectedGameTimeOption = GameTimeList[0];

            GameDateList           = HeroesHelpers.GameDates.GameDateList;
            SelectedGameDateOption = GameDateList[0];

            MapsList.Add("Any");
            MapsList.AddRange(HeroesIcons.MapBackgrounds().GetMapsList());
            SelectedMapOption = MapsList[0];

            ReplayBuildsList.Add("Any");
            ReplayBuildsList.AddRange(HeroesHelpers.Builds.GetBuildsList(HeroesIcons));
            SelectedBuildOption = ReplayBuildsList[0];

            HeroesList.Add("Any");
            HeroesList.AddRange(HeroesIcons.Heroes().GetListOfHeroes(HeroesIcons.GetLatestHeroesBuild()));
            SelectedCharacter = HeroesList[0];

            Messenger.Default.Register <MatchesDataMessage>(this, (message) => ReceivedMatchSearchData(message));
            Messenger.Default.Register <NotificationMessage>(this, async(message) => await ReceivedMessageAsync(message));
        }
        public void HeroExistsTest()
        {
            Assert.IsTrue(HeroesIcons.HeroBuilds().HeroExists("Anubarak"));
            Assert.IsTrue(HeroesIcons.HeroBuilds().HeroExists("Anub'arak"));

            Assert.IsFalse(HeroesIcons.HeroBuilds().HeroExists("asdf"));
        }
 public void HeroUnitNameTest()
 {
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromHeroUnitName("HeroAbathur") == "Abathur");
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromHeroUnitName(string.Empty) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromHeroUnitName(null) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromHeroUnitName("asdf") == null);
 }
        public void GetHeroInfoTest()
        {
            Hero heroInfo = HeroesIcons.HeroBuilds().GetHeroInfo(string.Empty);

            Assert.IsTrue(heroInfo.Name == string.Empty);
            Assert.IsTrue(heroInfo.Franchise == HeroFranchise.Unknown);
            Assert.IsTrue(heroInfo.HeroPortrait.Contains(HeroesBase.NoPortraitFound));
            Assert.IsTrue(heroInfo.LeaderboardPortrait.Contains(HeroesBase.NoLeaderboardFound));
            Assert.IsTrue(heroInfo.LoadingPortrait.Contains(HeroesBase.NoLoadingScreenFound));
            Assert.IsTrue(heroInfo.GetHeroPortrait() != null);
            Assert.IsTrue(heroInfo.GetLeaderboardPortrait() != null);
            Assert.IsTrue(heroInfo.GetLoadingPortrait() != null);

            heroInfo = HeroesIcons.HeroBuilds().GetHeroInfo(null);
            Assert.IsTrue(heroInfo.Name == null);
            Assert.IsTrue(heroInfo.Franchise == HeroFranchise.Unknown);
            Assert.IsTrue(heroInfo.HeroPortrait.Contains(HeroesBase.NoPortraitPick));
            Assert.IsTrue(heroInfo.LeaderboardPortrait.Contains(HeroesBase.NoLeaderboardPick));
            Assert.IsTrue(heroInfo.LoadingPortrait.Contains(HeroesBase.NoLoadingScreenPick));
            Assert.IsTrue(heroInfo.GetHeroPortrait() != null);
            Assert.IsTrue(heroInfo.GetLeaderboardPortrait() != null);
            Assert.IsTrue(heroInfo.GetLoadingPortrait() != null);

            heroInfo = HeroesIcons.HeroBuilds().GetHeroInfo("Anubarak");
            Assert.IsTrue(heroInfo.Name == "Anub'arak");
            Assert.IsTrue(heroInfo.Franchise == HeroFranchise.Warcraft);
        }
        public void GetMVPScreenAwardTest()
        {
            List <string> assertMessages = new List <string>();

            foreach (var map in HeroesIcons.MatchAwards().GetMatchAwardsList())
            {
                if (HeroesIcons.MatchAwards().GetMVPScreenAward(map, MVPScreenColor.Blue, out string awardNameBlue) == null || string.IsNullOrEmpty(awardNameBlue))
                {
                    assertMessages.Add($"[Screen Award] [{map}] (blue) Stream is null or no award name");
                }

                if (HeroesIcons.MatchAwards().GetMVPScreenAward(map, MVPScreenColor.Red, out string awardNameRed) == null || string.IsNullOrEmpty(awardNameRed))
                {
                    assertMessages.Add($"[Screen Award] [{map}] (red) Stream is null or no award name");
                }

                if (HeroesIcons.MatchAwards().GetMVPScreenAward(map, MVPScreenColor.Gold, out string awardNameGold) == null || string.IsNullOrEmpty(awardNameGold))
                {
                    assertMessages.Add($"[Screen Award] [{map}] (gold) Stream is null or no award name");
                }
            }

            if (HeroesIcons.MatchAwards().GetMVPScreenAward("asdf", MVPScreenColor.Blue, out string awardName) == null || string.IsNullOrEmpty(awardName))
            {
                assertMessages.Add($"[Screen Award] [asdf] (blue) Stream is null or no award name");
            }

            AssertFailMessage(assertMessages);
        }
        public void HeroesTest()
        {
            HeroesIcons   heroesIcons    = new HeroesIcons(false);
            List <string> assertMessages = new List <string>();
            int           segment        = 4;

            foreach (int build in heroesIcons.GetListOfHeroesBuilds())
            {
                heroesIcons.LoadHeroesBuild(build);

                var heroes = heroesIcons.Heroes().GetListOfHeroes(build);

                foreach (var hero in heroes)
                {
                    string altName = heroesIcons.Heroes().GetAltNameFromRealHeroName(hero);

                    if (string.IsNullOrEmpty(altName))
                    {
                        Assert.Fail($"[{build}] alt name is null or emtpy for {hero}");
                    }

                    BitmapImage heroLeaderBoardPortrait = heroesIcons.Heroes().GetHeroLeaderboardPortrait(hero);
                    BitmapImage heroLoadingPortrait     = heroesIcons.Heroes().GetHeroLoadingPortrait(hero);
                    BitmapImage heroPortrait            = heroesIcons.Heroes().GetHeroPortrait(hero);

                    if (heroLeaderBoardPortrait.UriSource.Segments[segment].ToString() != $"storm_ui_ingame_hero_leaderboard_{GetUniqueHeroName(altName.ToLower())}.dds")
                    {
                        assertMessages.Add($"[{build}] Leaderboard portrait not found for {hero}");
                    }

                    if (heroLoadingPortrait.UriSource.Segments[segment].ToString() != $"storm_ui_ingame_hero_loadingscreen_{GetUniqueHeroName(altName.ToLower())}.dds")
                    {
                        assertMessages.Add($"[{build}] Loading portrait not found for {hero}");
                    }

                    if (heroPortrait.UriSource.Segments[segment].ToString() != $"storm_ui_ingame_heroselect_btn_{GetUniqueHeroName(altName.ToLower())}.dds")
                    {
                        assertMessages.Add($"[{build}] Hero portrait not found for {hero}");
                    }

                    if (heroesIcons.Heroes().GetHeroFranchise(hero) == HeroFranchise.Unknown)
                    {
                        assertMessages.Add($"[{build}] Unknown franchise for {hero}");
                    }

                    var heroRoles = heroesIcons.Heroes().GetHeroRoleList(hero);
                    if (heroRoles[0] == HeroRole.Unknown)
                    {
                        assertMessages.Add($"[{build}] Unknown hero role for {hero}");
                    }
                    if (heroRoles.Count > 1 && heroRoles[0] != HeroRole.Multiclass)
                    {
                        assertMessages.Add($"[{build}] Hero {hero} has multiple roles but first role is NOT Multiclass");
                    }
                }
            }

            AssertFailMessage(assertMessages);
        }
 public void GetRealHeroNameFromShortNameTest()
 {
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromShortName("Anubarak") == "Anub'arak");
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromShortName("Abathur") == "Abathur");
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromShortName(string.Empty) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromShortName(null) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromShortName("asdf") == null);
 }
 public void GetRealHeroNameFromAttributeIdTest()
 {
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromAttributeId("Abat") == "Abathur");
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromAttributeId("Anub") == "Anub'arak");
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromAttributeId(string.Empty) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromAttributeId(null) == string.Empty);
     Assert.IsTrue(HeroesIcons.HeroBuilds().GetRealHeroNameFromAttributeId("asdf") == null);
 }
        public void GetMapNameByMapAlternativeName()
        {
            Assert.IsTrue(HeroesIcons.MapBackgrounds().GetMapNameByMapAlternativeName("ControlPoints") == "Sky Temple");
            Assert.IsTrue(HeroesIcons.MapBackgrounds().GetMapNameByMapAlternativeName("Shrines") == "Infernal Shrines");

            Assert.IsTrue(HeroesIcons.MapBackgrounds().GetMapNameByMapAlternativeName(string.Empty) == string.Empty);
            Assert.IsTrue(HeroesIcons.MapBackgrounds().GetMapNameByMapAlternativeName(null) == string.Empty);
            Assert.IsNull(HeroesIcons.MapBackgrounds().GetMapNameByMapAlternativeName("asdf"));
        }
        public void SetPlayerInfo(bool isAutoSelect, Dictionary <int, PartyIconColor> playerPartyIcons, Dictionary <long, string> matchAwardDictionary)
        {
            var playerInfo = Database.ReplaysDb().HotsPlayer.ReadRecordFromPlayerId(Player.PlayerId);

            Hero hero = HeroesIcons.HeroesData(Build).HeroData(Player.Character, includeAbilities: false, additionalUnits: false);

            LeaderboardPortrait = Player.Character != "None" ? hero.HeroPortrait.LeaderboardImage() : null;
            Silenced            = Player.IsSilenced;
            VoiceSilenced       = Player.IsVoiceSilenced;
            CharacterName       = hero.Name;
            PlayerName          = Database.SettingsDb().UserSettings.IsBattleTagHidden ? HeroesHelpers.BattleTags.GetNameFromBattleTagName(playerInfo.BattleTagName) : playerInfo.BattleTagName;
            PlayerBattleTagName = playerInfo.BattleTagName;
            PlayerRegion        = (Region)playerInfo.BattleNetRegionId;
            IsUserPlayer        = (playerInfo.PlayerId == UserProfile.PlayerId && playerInfo.BattleNetRegionId == UserProfile.RegionId) ? true : false;
            HasActiveBoost      = Player.HasActiveBoost;

            if (Player.Team == 4)
            {
                CharacterLevel = "Observer";
            }
            else
            {
                CharacterLevel = isAutoSelect ? "Auto Select" : Player.CharacterLevel.ToString();
            }

            PlayerTag = new PlayerTag
            {
                PlayerName        = PlayerName,
                AccountLevel      = Player.AccountLevel > 0 ? Player.AccountLevel.ToString() : "N/A",
                TotalSeen         = playerInfo.Seen,
                LastSeenBefore    = playerInfo.LastSeenBefore.HasValue ? playerInfo.LastSeenBefore.Value.ToString() : "Never",
                FormerPlayerNames = Database.ReplaysDb().RenamedPlayer.ReadPlayersFromPlayerId(playerInfo.PlayerId),
                Notes             = playerInfo.Notes ?? string.Empty,
            };

            HeroDescription = new HeroDescription
            {
                HeroName     = hero.Name,
                Description  = hero.Description.ColoredText,
                Franchise    = hero.HeroFranchiseImage(),
                Type         = hero.Type,
                Difficulty   = hero.Difficulty,
                Roles        = hero.Roles.ToList(),
                ExpandedRole = hero.ExpandedRole,
            };

            if (playerPartyIcons.ContainsKey(Player.PlayerNumber))
            {
                SetPartyIcon(playerPartyIcons[Player.PlayerNumber]);
            }

            if (matchAwardDictionary.ContainsKey(Player.PlayerId))
            {
                SetMVPAward(matchAwardDictionary[Player.PlayerId]);
            }
        }
Beispiel #11
0
        public void SetPlayerInfo(bool isAutoSelect, Dictionary <int, PartyIconColor> playerPartyIcons, Dictionary <long, string> matchAwardDictionary)
        {
            var playerInfo = Database.ReplaysDb().HotsPlayer.ReadRecordFromPlayerId(Player.PlayerId);

            LeaderboardPortrait = Player.Character != "None" ? HeroesIcons.Heroes().GetHeroLeaderboardPortrait(Player.Character) : null;
            CharacterTooltip    = $"{Player.Character}{Environment.NewLine}{HeroesIcons.Heroes().GetHeroRoleList(Player.Character)[0]}";
            Silenced            = Player.IsSilenced;
            CharacterName       = Player.Character;

            PlayerName          = Database.SettingsDb().UserSettings.IsBattleTagHidden ? HeroesHelpers.BattleTags.GetNameFromBattleTagName(playerInfo.BattleTagName) : playerInfo.BattleTagName;
            PlayerBattleTagName = playerInfo.BattleTagName;
            PlayerRegion        = (Region)playerInfo.BattleNetRegionId;
            IsUserPlayer        = (playerInfo.PlayerId == UserProfile.PlayerId && playerInfo.BattleNetRegionId == UserProfile.RegionId) ? true : false;

            if (Player.Team == 4)
            {
                CharacterLevel = "Observer";
            }
            else
            {
                CharacterLevel = isAutoSelect ? "Auto Select" : Player.CharacterLevel.ToString();
            }

            if (Player.AccountLevel > 0)
            {
                AccountLevel = Player.AccountLevel.ToString();
            }
            else
            {
                AccountLevel = "N/A";
            }

            if (playerPartyIcons.ContainsKey(Player.PlayerNumber))
            {
                SetPartyIcon(playerPartyIcons[Player.PlayerNumber]);
            }

            if (matchAwardDictionary.ContainsKey(Player.PlayerId))
            {
                SetMVPAward(matchAwardDictionary[Player.PlayerId]);
            }

            string lastSeenBefore;

            if (playerInfo.LastSeenBefore.HasValue)
            {
                lastSeenBefore = playerInfo.LastSeenBefore.Value.ToString();
            }
            else
            {
                lastSeenBefore = "Never";
            }

            PlayerNameTooltip = $"{PlayerName}{Environment.NewLine}Account Level: {AccountLevel}{Environment.NewLine}Total Seen: {playerInfo.Seen}{Environment.NewLine}Last Seen Before: {lastSeenBefore}";
        }
 private bool IsHealingStatCharacter(string realHeroName)
 {
     if (HeroesIcons.Heroes().GetHeroRoleList(realHeroName)[0] == HeroRole.Support || HeroesIcons.IsNonSupportHeroWithHealingStat(realHeroName))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #13
0
        public MatchPlayerBase(IInternalService internalService, IWebsiteService website, ReplayMatchPlayer player)
        {
            Database    = internalService.Database;
            HeroesIcons = internalService.HeroesIcons;
            UserProfile = internalService.UserProfile;
            Website     = website;
            Player      = player;

            SilenceIcon = HeroesIcons.GetOtherIcon(OtherIcon.Silence);
            TalentBorderScoreScreenIcon = HeroesIcons.GetOtherIcon(OtherIcon.TalentAvailable);
        }
Beispiel #14
0
 private bool IsHealingStatCharacter(string realHeroName)
 {
     if (HeroesIcons.HeroBuilds().GetHeroInfo(realHeroName).Roles.FirstOrDefault() == HeroRole.Support || HeroesIcons.IsNonSupportHeroWithHealingStat(realHeroName))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #15
0
        public void SetTalents(ReplayMatchPlayerTalent playerTalentList)
        {
            HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName1);
            var talent1  = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName1);
            var talent4  = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName4);
            var talent7  = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName7);
            var talent10 = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName10);
            var talent13 = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName13);
            var talent16 = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName16);
            var talent20 = HeroesIcons.HeroBuilds().GetHeroInfo(playerTalentList.Character).GetTalent(playerTalentList.TalentName20);

            Talents.Add(talent1.GetIcon());
            Talents.Add(talent4.GetIcon());
            Talents.Add(talent7.GetIcon());
            Talents.Add(talent10.GetIcon());
            Talents.Add(talent13.GetIcon());
            Talents.Add(talent16.GetIcon());
            Talents.Add(talent20.GetIcon());

            TalentNames.Add(talent1.Name);
            TalentNames.Add(talent4.Name);
            TalentNames.Add(talent7.Name);
            TalentNames.Add(talent10.Name);
            TalentNames.Add(talent13.Name);
            TalentNames.Add(talent16.Name);
            TalentNames.Add(talent20.Name);

            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent1.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent4.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent7.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent10.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent13.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent16.Name}:</c> {talent1.Tooltip.Short}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent20.Name}:</c> {talent1.Tooltip.Short}");

            TalentFullTooltips.Add(talent1.Tooltip.Full);
            TalentFullTooltips.Add(talent4.Tooltip.Full);
            TalentFullTooltips.Add(talent7.Tooltip.Full);
            TalentFullTooltips.Add(talent10.Tooltip.Full);
            TalentFullTooltips.Add(talent13.Tooltip.Full);
            TalentFullTooltips.Add(talent16.Tooltip.Full);
            TalentFullTooltips.Add(talent20.Tooltip.Full);

            TalentSubInfo.Add(talent1.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent4.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent7.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent10.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent13.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent16.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent20.Tooltip.GetTalentSubInfo());
        }
        public void SetTalents(ReplayMatchPlayerTalent playerTalentList)
        {
            Talent talent1  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName1);
            Talent talent4  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName4);
            Talent talent7  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName7);
            Talent talent10 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName10);
            Talent talent13 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName13);
            Talent talent16 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName16);
            Talent talent20 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName20);

            Talents.Add(talent1.AbilityTalentImage());
            Talents.Add(talent4.AbilityTalentImage());
            Talents.Add(talent7.AbilityTalentImage());
            Talents.Add(talent10.AbilityTalentImage());
            Talents.Add(talent13.AbilityTalentImage());
            Talents.Add(talent16.AbilityTalentImage());
            Talents.Add(talent20.AbilityTalentImage());

            TalentNames.Add(talent1.Name);
            TalentNames.Add(talent4.Name);
            TalentNames.Add(talent7.Name);
            TalentNames.Add(talent10.Name);
            TalentNames.Add(talent13.Name);
            TalentNames.Add(talent16.Name);
            TalentNames.Add(talent20.Name);

            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent1.Name}:</c> {talent1.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent4.Name}:</c> {talent4.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent7.Name}:</c> {talent7.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent10.Name}:</c> {talent10.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent13.Name}:</c> {talent13.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent16.Name}:</c> {talent16.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent20.Name}:</c> {talent20.Tooltip?.ShortTooltip?.ColoredText}");

            TalentFullTooltips.Add(talent1.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent4.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent7.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent10.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent13.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent16.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent20.Tooltip?.FullTooltip?.ColoredText);

            TalentSubInfo.Add(talent1.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent4.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent7.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent10.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent13.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent16.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent20.Tooltip.GetTalentSubInfo());
        }
        public void GetFranchiseIconTests()
        {
            List <string> assertMessages = new List <string>();

            foreach (HeroFranchise icon in Enum.GetValues(typeof(HeroFranchise)))
            {
                if (HeroesIcons.GetFranchiseIcon(icon) == null)
                {
                    assertMessages.Add($"Franchise icon {icon} is null");
                }
            }

            AssertFailMessage(assertMessages);
        }
        public void GetPartyIconTests()
        {
            List <string> assertMessages = new List <string>();

            foreach (PartyIconColor icon in Enum.GetValues(typeof(PartyIconColor)))
            {
                if (HeroesIcons.GetPartyIcon(icon) == null)
                {
                    assertMessages.Add($"Party icon {icon} is null");
                }
            }

            AssertFailMessage(assertMessages);
        }
        public void HeroesHomescreensTest()
        {
            List <string> assertMessages = new List <string>();

            foreach (var homescreen in HeroesIcons.Homescreens().GetHomescreensList())
            {
                if (HeroesIcons.Homescreens().GetHomescreen(homescreen) == null)
                {
                    assertMessages.Add($"No homescreen stream found for {homescreen}");
                }
            }

            AssertFailMessage(assertMessages);
        }
Beispiel #20
0
        private void SetMVPAward(string awardType)
        {
            MVPScoreScreenColor teamColor;

            if (Player.Team == 0)
            {
                teamColor = MVPScoreScreenColor.Blue;
            }
            else
            {
                teamColor = MVPScoreScreenColor.Red;
            }

            MvpAward            = HeroesIcons.MatchAwards().GetMVPScoreScreenAward(awardType, teamColor, out string mvpAwardName);
            MvpAwardDescription = $"{mvpAwardName}{Environment.NewLine}{HeroesIcons.MatchAwards().GetMatchAwardDescription(awardType)}";
        }
Beispiel #21
0
        public StatsPartiesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow)
            : base(internalService)
        {
            LoadingOverlayWindow = loadingOverlayWindow;

            SeasonList.Add(InitialSeasonListOption);
            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeason = SeasonList[0];

            HeroesList.Add(InitialHeroListOption);
            HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList());

            SelectedCharacter = Enumerable.Repeat(InitialHeroListOption, SelectedCharacter.Length).ToArray();

            ClearOptions();
        }
Beispiel #22
0
        /// <summary>
        /// Returns the ScoreScreen award Stream of the given mvpAwardType and color
        /// </summary>
        /// <param name="mvpAwardType">Reference name of award</param>
        /// <param name="mvpColor">Color of icon</param>
        /// <param name="awardName"></param>
        /// <returns></returns>
        public Stream GetMVPScoreScreenAward(string mvpAwardType, MVPScoreScreenColor mvpColor, out string awardName)
        {
            if (MVPScoreScreenAwardByAwardType.ContainsKey(mvpAwardType))
            {
                var award = MVPScoreScreenAwardByAwardType[mvpAwardType];

                awardName = award.Item1;
                return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(award.Item2.Replace("{mvpColor}", mvpColor.ToString().ToLowerInvariant())));
            }
            else
            {
                LogReferenceNameNotFound($"MVP score screen award type: {mvpAwardType}");
                awardName = mvpAwardType;
                return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(SetImageStreamString($"{TalentFolderName}.{TalentGenericFolderName}", NoTalentIconFound)));
            }
        }
        public void HeroesMapBackgroundsTest()
        {
            HeroesIcons   heroesIcons    = new HeroesIcons(false);
            List <string> assertMessages = new List <string>();

            Assert.AreEqual(heroesIcons.MapBackgrounds().TotalCountOfMaps(), heroesIcons.MapBackgrounds().GetMapsList().Count, "Number of awards in _AllMapBackgrounds.xml is not equal to number of MapBackgrounds");
            Assert.AreEqual(heroesIcons.MapBackgrounds().TotalCountOfMaps(), Directory.GetFiles($@"Xml\MapBackgrounds").Count() - 1, "Number of maps in _AllMapBackgrounds.xml is not equal to number of files in Xml\\MapBackgrounds");

            foreach (var map in heroesIcons.MapBackgrounds().GetMapsList())
            {
                if (heroesIcons.MapBackgrounds().GetMapBackground(map) == null)
                {
                    assertMessages.Add($"No image found for {map}");
                }
            }
        }
        public void GetMapNameTranslation()
        {
            Assert.IsTrue(HeroesIcons.MapBackgrounds().MapNameTranslation("工业园区", out string mapName));
            Assert.IsTrue(mapName == "Industrial District");

            Assert.IsTrue(HeroesIcons.MapBackgrounds().MapNameTranslation("Ich glaub, es hakt", out mapName));
            Assert.IsTrue(mapName == "Pull Party");

            Assert.IsFalse(HeroesIcons.MapBackgrounds().MapNameTranslation(string.Empty, out mapName));
            Assert.IsTrue(mapName == string.Empty);

            Assert.IsFalse(HeroesIcons.MapBackgrounds().MapNameTranslation(null, out mapName));
            Assert.IsTrue(mapName == string.Empty);

            Assert.IsFalse(HeroesIcons.MapBackgrounds().MapNameTranslation("asdf", out mapName));
            Assert.IsTrue(mapName == null);
        }
        public void HeroesMapBackgroundsTest()
        {
            List <string> assertMessages = new List <string>();

            Assert.AreEqual(HeroesIcons.MapBackgrounds().TotalCountOfMaps(), HeroesIcons.MapBackgrounds().GetMapsList().Count, "Number of maps in _AllMapBackgrounds.xml is not equal to number of MapBackgrounds");
            Assert.AreEqual(HeroesIcons.MapBackgrounds().TotalCountOfMaps(), Directory.GetFiles(Path.Combine("Xml", "MapBackgrounds")).Count() - 1, "Number of maps in _AllMapBackgrounds.xml is not equal to number of files in Xml\\MapBackgrounds");

            foreach (var map in HeroesIcons.MapBackgrounds().GetMapsList())
            {
                if (HeroesIcons.MapBackgrounds().GetMapBackground(map) == null)
                {
                    assertMessages.Add($"No map stream found for {map}");
                }
            }

            AssertFailMessage(assertMessages);
        }
        private void SetMVPAward(string awardType)
        {
            ScoreScreenAwardColor teamColor;

            if (Player.Team == 0)
            {
                teamColor = ScoreScreenAwardColor.Blue;
            }
            else
            {
                teamColor = ScoreScreenAwardColor.Red;
            }

            MatchAward matchAward = HeroesIcons.MatchAwards(Build).MatchAward(awardType);

            MvpAward            = matchAward.MatchAwardScoreScreenImage(teamColor);
            MvpAwardDescription = $"{matchAward.Name}{Environment.NewLine}{matchAward.Description}";
        }
        public void GetRoleIconTests()
        {
            List <string> assertMessages = new List <string>();

            foreach (HeroRole icon in Enum.GetValues(typeof(HeroRole)))
            {
                if (icon == HeroRole.Multiclass)
                {
                    continue;
                }

                if (HeroesIcons.GetRoleIcon(icon) == null)
                {
                    assertMessages.Add($"Role icon {icon} is null");
                }
            }

            AssertFailMessage(assertMessages);
        }
        public void GetMatchAwardDescriptionTest()
        {
            List <string> assertMessages = new List <string>();

            foreach (var map in HeroesIcons.MatchAwards().GetMatchAwardsList())
            {
                if (string.IsNullOrEmpty(HeroesIcons.MatchAwards().GetMatchAwardDescription(map)))
                {
                    assertMessages.Add($"[{map}] description is null or empty");
                }
            }

            if (!string.IsNullOrEmpty(HeroesIcons.MatchAwards().GetMatchAwardDescription("asdf")))
            {
                assertMessages.Add($"[asdf] description is NOT empty");
            }

            AssertFailMessage(assertMessages);
        }
Beispiel #29
0
 public Stream GetMapBackground(string mapRealName)
 {
     try
     {
         if (MapStringByMapRealName.ContainsKey(mapRealName))
         {
             return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(MapStringByMapRealName[mapRealName]));
         }
         else
         {
             LogReferenceNameNotFound($"Map background: {mapRealName}");
             return(null);
         }
     }
     catch (IOException)
     {
         LogReferenceNameNotFound($"Map background: {mapRealName}");
         return(null);
     }
 }
Beispiel #30
0
 public Stream GetHomescreen(string homescreenName)
 {
     try
     {
         if (HomescreenStringByMapName.ContainsKey(homescreenName))
         {
             return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(HomescreenStringByMapName[homescreenName]));
         }
         else
         {
             LogReferenceNameNotFound($"Homescreen: {homescreenName}");
             return(null);
         }
     }
     catch (IOException)
     {
         LogReferenceNameNotFound($"Homescreen: {homescreenName}");
         return(null);
     }
 }