-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
125 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Windows; | ||
using System.Windows.Shapes; | ||
using System.Windows.Controls; | ||
using System.Collections.Generic; | ||
using Hearthstone_Deck_Tracker; | ||
using Hearthstone_Deck_Tracker.Controls; | ||
using Card = Hearthstone_Deck_Tracker.Hearthstone.Card; | ||
|
||
namespace HDT.Plugins.Graveyard | ||
{ | ||
public class ChancesTracker | ||
{ | ||
private Dictionary<Card, HearthstoneTextBlock> _chances = new Dictionary<Card, HearthstoneTextBlock>(); | ||
|
||
public void Update(Card card, List<Card> Cards, AnimatedCardList View) | ||
{ | ||
var count = (double)Cards.Aggregate(0, (total, c) => total + c.Count); | ||
for (var i = 0; i < Cards.Count(); i++) | ||
{ | ||
if (!_chances.ContainsKey(Cards[i])) | ||
{ | ||
var chance = new HearthstoneTextBlock(); | ||
chance.FontSize = 18; | ||
chance.TextAlignment = TextAlignment.Left; | ||
var grid = (View.Items.GetItemAt(i) as UserControl).Content as Grid; | ||
grid.Width = 260; | ||
(grid.Children[0] as Hearthstone_Deck_Tracker.Controls.Card).HorizontalAlignment = HorizontalAlignment.Right; | ||
(grid.Children[1] as Rectangle).Width = 260; | ||
grid.Children.Add(chance); | ||
_chances.Add(Cards[i], chance); | ||
} | ||
|
||
_chances[Cards[i]].Text = $"{Math.Round(Cards[i].Count / count * 100)}%"; | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using System.Linq; | ||
using Hearthstone_Deck_Tracker; | ||
using Hearthstone_Deck_Tracker.Hearthstone; | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Linq; | ||
using Hearthstone_Deck_Tracker; | ||
using Hearthstone_Deck_Tracker.Hearthstone; | ||
|
||
namespace HDT.Plugins.Graveyard | ||
{ | ||
public class HadronoxView : NormalView | ||
{ | ||
public static bool isValid() | ||
{ | ||
return Core.Game.Player.PlayerCardList.FindIndex(card => card.Id == HearthDb.CardIds.Collectible.Druid.Hadronox) > -1; | ||
} | ||
|
||
public HadronoxView() | ||
{ | ||
// Section Label | ||
Label.Text = "Hadronox"; | ||
} | ||
|
||
new public bool Update(Card card) | ||
{ | ||
return card.Mechanics.Contains("Taunt") && base.Update(card); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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