コード例 #1
0
            private bool IsMinimumBlockerCountSatisfied(ChosenBlockers chosen)
            {
                var attackers = chosen
                                .GroupBy(x => x.Attacker)
                                .Select(x => new
                {
                    Card         = x.Key,
                    BlockerCount = x.Count()
                })
                                .ToList();

                return(attackers.All(attacker => attacker.Card.MinimalBlockerCount <= attacker.BlockerCount));
            }
コード例 #2
0
ファイル: DeclareBlockers.cs プロジェクト: callumhutchy/grove
            private bool IsBlockerCountSatisfied(ChosenBlockers chosen)
            {
                var attackers = chosen
                                .GroupBy(x => x.Attacker)
                                .Select(x => new
                {
                    Card         = x.Key,
                    BlockerCount = x.Count()
                })
                                .ToList();

                return(attackers.All(attacker => attacker.Card.MinimalBlockerCount <= attacker.BlockerCount &&
                                     (!attacker.Card.Has().CannotBeBlockedByMoreThanOne || attacker.BlockerCount <= 1)));
            }