Ejemplo n.º 1
0
 public Ingredient Clone(IngredientOperation operation, int newLevel)
 {
     return(new Ingredient(
                Name,
                newLevel,
                BaseCost,
                EffectTreesPossible.ToArray(),
                CurrentEffectLevels.ToArray(),
                new IngredientOperations(Operations, operation)));
 }
Ejemplo n.º 2
0
        public Ingredient Mix(Ingredient other)
        {
            // The base has no free slots? Result will be the base.
            if (!EffectTreesPossible.Any(e => e is EmptyEffectTree))
            {
                return(this);
            }

            var result = Clone(IngredientOperation.GetMixing(new List <Ingredient> {
                this, other
            }), Level);

            for (int i = 0; i < result.EffectTreesPossible.Length; i++)
            {
                if (result.EffectTreesPossible[i] is EmptyEffectTree)
                {
                    result.EffectTreesPossible[i] = other.EffectTreesPossible[i];
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
 public IEnumerable <PositiveEffectTree> GetPositiveEffectTrees()
 {
     return(EffectTreesPossible.Where(t => t is PositiveEffectTree).Cast <PositiveEffectTree>());
 }
Ejemplo n.º 4
0
 public IEnumerable <SideEffectTree> GetSideEffectTrees()
 {
     return(EffectTreesPossible.Where(t => t is SideEffectTree).Cast <SideEffectTree>());
 }
Ejemplo n.º 5
0
 public IEnumerable <EffectTree> GetemptyTrees()
 {
     return(EffectTreesPossible.Where(t => t is EmptyEffectTree));
 }