add missing files
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace KernelPanic.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Shared card eligibility rules for previews, playability checks, and effect execution.
|
||||
/// </summary>
|
||||
public static class CardEligibility
|
||||
{
|
||||
public static bool IsJunkForAutoremove(CardInstance card)
|
||||
{
|
||||
return card != null && (card.IsBroken || card.Definition != null && card.Definition.IsJunk);
|
||||
}
|
||||
|
||||
public static CardInstance FindAutoremoveTarget(IReadOnlyList<CardInstance> hand, CardInstance playedCard)
|
||||
{
|
||||
if (hand == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < hand.Count; i++)
|
||||
{
|
||||
CardInstance card = hand[i];
|
||||
if (card != playedCard && IsJunkForAutoremove(card))
|
||||
{
|
||||
return card;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user