コード例 #1
0
        public List <int> Results()
        {
            var claimIdsWithoutOverlap = new List <int>();

            var positionsWithClaims = FabricWithClaims.PositionsWithClaims();

            foreach (var claims in positionsWithClaims.Values)
            {
                foreach (var claim in claims)
                {
                    claimIdsWithoutOverlap.Add(claim.ClaimId);
                }
            }

            claimIdsWithoutOverlap = claimIdsWithoutOverlap.Distinct().ToList();

            foreach (FabricPosition fabricPosition in positionsWithClaims.Keys)
            {
                var claims = positionsWithClaims[fabricPosition];

                if (claims.Count != 1)
                {
                    foreach (Claim claimToRemove in claims)
                    {
                        claimIdsWithoutOverlap.Remove(claimToRemove.ClaimId);
                    }
                }
            }

            return(claimIdsWithoutOverlap);
        }
コード例 #2
0
        public int Results()
        {
            int squareInchesWithClaims = 0;

            var positionsWithClaims = FabricWithClaims.PositionsWithClaims();

            foreach (FabricPosition fabricPosition in positionsWithClaims.Keys)
            {
                var claims = positionsWithClaims[fabricPosition];

                if (claims.Count >= ClaimsCount)
                {
                    squareInchesWithClaims++;
                }
            }

            return(squareInchesWithClaims);
        }
コード例 #3
0
 public ClaimsWithNoOverlapQuery(FabricWithClaims fabricWithClaims)
 {
     FabricWithClaims = fabricWithClaims;
 }
コード例 #4
0
 public FabricWithAtleastClaimsQuery(FabricWithClaims fabricWithClaims, int claimsCount)
 {
     FabricWithClaims = fabricWithClaims;
     ClaimsCount      = claimsCount;
 }