Esempio n. 1
0
        bool TrySatisfySlot(RecipeSlot slot, IEnumerable <ElementStackToken> candidates)
        {
            if (slot.GetElementStackInSlot() != null)
            {
                // Already something in the slot.
                return(true);
            }

            var candidate = candidates.FirstOrDefault(x => slot.GetSlotMatchForStack(x).MatchType == SlotMatchForAspectsType.Okay);

            if (candidate == null)
            {
                return(false);
            }

            this.PopulateSlot(slot, candidate);
            return(true);
        }
Esempio n. 2
0
 public static bool StackMatchesSlot(IElementStack elementStack, RecipeSlot slot)
 {
     return(slot.GetSlotMatchForStack(elementStack).MatchType == SlotMatchForAspectsType.Okay);
 }