-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: fizzle snapshot tracking * wip: add link between copied card and the original * wip: work for multiple snapshots * wip: player's tidepool pupil tracking * wip: display related cards on overlay and hydration station * wip: show related cards grid * wip: show related cards when hovering in hand * wip: scale grid depending on maxHeight - useful because when hovering cards in hand we need to make the grid smaller so the highlighted card doesnt cover it * wip: hover on hand work for deck on the left * fix: tidepool pupil considering non spell cards * fix: display card grid position when scaling window * fix: clear related cards when card is shuffled into the deck * feat: show related cards on hover in hand * wip: add related cards label * wip: add cards implementations * fix: add zindex to cardgridtooltip * fix: grid positioning * feat: add pet parrot * chore: add related cards tooltip to the configs * refactor: create functions to set related cards tooltip Also: - adjusts indentation - adds comment for fizzle snapshot * fix: update VMActionTests * feat: update tyr to only show unique cards * feat: localize tooltip label * refactor: move GetRelatedCards to a new class * refactor: create RelatedCardsSystem * refactor: create CardUtils * feat: implement cards with related cards * refactor: delete old related cards handler * fix: stop showing card on related cards box when it is already on player decklist * fix: tooltip on deckLens when the deck is big * fix: update MockGame * fix: use localized string * fix: Tyrs Tears normal and forged cardIds * fix: hover on hand for entity related cards * feat: add Product9 * feat: add Lady Liadrin * feat: add Shudderwock * fix: multiple entity related cards in hand
- Loading branch information
1 parent
c11570e
commit ebec50c
Showing
49 changed files
with
948 additions
and
67 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
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using HearthDb.Enums; | ||
using Hearthstone_Deck_Tracker.Enums; | ||
|
||
namespace Hearthstone_Deck_Tracker.Hearthstone; | ||
|
||
public static class CardUtils | ||
{ | ||
public static IEnumerable<Card?> FilterCardsByFormat(this IEnumerable<Card?> cards, Format? format) | ||
{ | ||
return cards.Where(card => IsCardFromFormat(card, format)); | ||
} | ||
|
||
public static bool IsCardFromFormat(Card? card, Format? format) | ||
{ | ||
return format switch | ||
{ | ||
Format.Classic => card != null && Helper.ClassicOnlySets.Contains(card.Set), | ||
Format.Wild => card != null && !Helper.ClassicOnlySets.Contains(card.Set), | ||
Format.Standard => card != null && !Helper.WildOnlySets.Contains(card.Set) && !Helper.ClassicOnlySets.Contains(card.Set), | ||
Format.Twist => card != null && Helper.TwistSets.Contains(card.Set), | ||
_ => true | ||
}; | ||
} | ||
|
||
public static IEnumerable<Card?> FilterCardsByPlayerClass(this IEnumerable<Card?> cards, string? playerClass, bool ignoreNeutral = false) | ||
{ | ||
return cards.Where(card => IsCardFromPlayerClass(card, playerClass, ignoreNeutral)); | ||
} | ||
|
||
public static bool IsCardFromPlayerClass(Card? card, string? playerClass, bool ignoreNeutral = false) | ||
{ | ||
return card != null && | ||
(card.PlayerClass == playerClass || card.GetTouristVisitClass() == playerClass || | ||
(!ignoreNeutral && card.CardClass == CardClass.NEUTRAL)); | ||
} | ||
|
||
public static bool MayCardBeRelevant(Card? card, Format? format, string? playerClass, | ||
bool ignoreNeutral = false) | ||
{ | ||
return IsCardFromFormat(card, format) && IsCardFromPlayerClass(card, playerClass, ignoreNeutral); | ||
} | ||
} |
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
Oops, something went wrong.