Ejemplo n.º 1
0
 public static bool Available(RecipeSlot slot)
 {
     return(!(
                slot == null ||
                slot.Equals(null) ||
                slot.Defunct ||
                slot.IsGreedy ||
                slot.IsBeingAnimated ||
                slot.GetElementStackInSlot() != null
                ));
 }
Ejemplo n.º 2
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);
        }