Skip to content

Commit

Permalink
Merge pull request #14 from ottowayne/percent_to_absolute
Browse files Browse the repository at this point in the history
Show absolute amount of matching cards instead of percentage value
  • Loading branch information
djdookie authored May 23, 2017
2 parents ebda259 + 4e0fc2b commit 598d07e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Advisor/Advisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,14 @@ internal async void UpdateCardList()
// Select best matched deck with both highest similarity value and most played games
var matchedDeck = topGamesDecks.First();

_advisorOverlay.LblArchetype.Text = String.Format("{0} ({1}%)", matchedDeck.Key.Name, Math.Round(matchedDeck.Value * 100, 2));
// Count how many cards from opponent deck are in selected deck
int matchingCards = 0;
foreach (var opponentDeckCard in opponentCardlist)
foreach (var selectedDeckCard in matchedDeck.Key.Cards)
if (!opponentDeckCard.IsCreated && opponentDeckCard.Equals(selectedDeckCard))
matchingCards++;

_advisorOverlay.LblArchetype.Text = String.Format("{0} ({1}/{2})", matchedDeck.Key.Name, matchingCards, opponentCardlist.Count);
_advisorOverlay.LblStats.Text = String.Format("{0}", matchedDeck.Key.Note);
Deck deck = DeckList.Instance.Decks.Where(d => d.TagList.ToLowerInvariant().Contains("archetype")).First(d => d.Name == matchedDeck.Key.Name);
if (deck != null)
Expand Down

0 comments on commit 598d07e

Please sign in to comment.