forked from RedHatter/Graveyard
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Azerite Rat view added - Kingpin Pud view added
- Loading branch information
Showing
6 changed files
with
73 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Hearthstone_Deck_Tracker.API; | ||
using Hearthstone_Deck_Tracker.Hearthstone; | ||
using System.Windows; | ||
using static HearthDb.CardIds.Collectible; | ||
|
||
namespace HDT.Plugins.Graveyard | ||
{ | ||
internal class AzeriteRatView : NormalView | ||
{ | ||
private static ViewConfig _Config; | ||
internal static ViewConfig Config | ||
{ | ||
get => _Config ?? (_Config = new ViewConfig( | ||
Deathknight.ReapWhatYouSow, | ||
Deathknight.SkeletonCrew) | ||
{ | ||
Name = Database.GetCardFromId(HearthDb.CardIds.NonCollectible.Deathknight.KoboldMiner_TheAzeriteRatToken)?.LocalizedName ?? "AzeriteRat", | ||
CreateView = () => new AzeriteRatView(), | ||
UpdateOn = GameEvents.OnPlayerPlayToGraveyard, | ||
Condition = card => card.Type == "Minion", | ||
}); | ||
} | ||
|
||
public override bool Update(Card card) | ||
{ | ||
if (!Condition(card)) return false; | ||
|
||
var removed = Cards.RemoveAll(c => c.Cost < card.Cost); | ||
if (removed > 0 || Cards.Count == 0) | ||
{ | ||
Cards.Add(card.Clone() as Card); | ||
View.Update(Cards, true); | ||
Visibility = Visibility.Visible; | ||
} | ||
#warning Always return false to pass card onto GraveyardView, other unwanted side effects? | ||
return false; | ||
} | ||
} | ||
} |
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,27 @@ | ||
using Hearthstone_Deck_Tracker.API; | ||
using System.Collections.Generic; | ||
using static HearthDb.CardIds.Collectible; | ||
|
||
namespace HDT.Plugins.Graveyard | ||
{ | ||
internal class OgreGangView | ||
{ | ||
private static ViewConfig _Config; | ||
internal static ViewConfig Config | ||
{ | ||
get => _Config ?? (_Config = new ViewConfig(Neutral.KingpinPud) | ||
{ | ||
CreateView = () => new NormalView(), | ||
UpdateOn = GameEvents.OnPlayerPlayToGraveyard, | ||
Condition = card => GangMembers.Contains(card.Id), | ||
}); | ||
} | ||
|
||
internal static readonly List<string> GangMembers = new List<string> | ||
{ | ||
Neutral.OgreGangAce, | ||
Neutral.OgreGangOutlaw, | ||
Neutral.OgreGangRider, | ||
}; | ||
} | ||
} |
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