public bool IsMet(RequirementContext context)
        {
            // Find Person A in the seating arrangement
            var seating = context.partyState.seatingArrangement;

            for (int i = 0; i < seating.tables.Count; ++i)
            {
                var table = seating.tables[i];
                var seat  = table.GetSeatFor(PersonA);
                if (seat != null)
                {
                    // Found PersonA seated at this table. Check the connected seats to see if we have PersonB
                    for (int j = 0; j < seat.connectedSeats.Count; ++j)
                    {
                        if (seat.connectedSeats[j].IsSeated(PersonB))
                        {
                            // We found PersonB next to PersonA
                            return(false);
                        }
                    }

                    // If we found PersonA, but PersonB wasn't next to them, this requirement is met
                    return(true);
                }
            }

            // We couldn't find PersonA at any table
            return(false);
        }
Exemplo n.º 2
0
        public bool IsMet(RequirementContext context)
        {
            for (int i = 0; i < context.partyState.foodArrangement.food.Count; ++i)
            {
                if (context.partyState.foodArrangement.food[i].DoesInclude(requiredFood))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        public bool IsMet(RequirementContext context)
        {
            for (int i = 0; i < context.partyState.contributionArrangement.contributions.Count; ++i)
            {
                if (requiredContribution.person == context.partyState.contributionArrangement.contributions[i].person &&
                    context.partyState.contributionArrangement.contributions[i].food.DoesInclude(requiredContribution.food))
                {
                    return(true);
                }
            }

            return(false);
        }