Beispiel #1
0
    public static void Test()
    {
        IPile <Card> cards = new UnfixedPile <Card>();

        // cards中所有活着的
        cards.Filter(card => !card.isDead);


        Map <Card, int> cardMaps = new Map <Card, int>();

        // 攻击力大于1的随从中有 有圣盾的随从吗?
        var judge = cardMaps
                    .FilterKey(card => card.GetMinionBody().x > 1)
                    .Any(card => card.keyWords.Contains(Keyword.DivineShield));
    }
Beispiel #2
0
    public IPile <T> Copy()
    {
        IPile <T> newPile = new UnfixedPile <T>();

        foreach (var item in this)
        {
            if (item is ICloneable card)
            {
                newPile.Add((T)card.Clone());
            }
            else
            {
                newPile.Add(item);
            }
        }
        return(newPile);
    }