public Ingredient Clone(IngredientOperation operation, int newLevel) { return(new Ingredient( Name, newLevel, BaseCost, EffectTreesPossible.ToArray(), CurrentEffectLevels.ToArray(), new IngredientOperations(Operations, operation))); }
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); }
public IEnumerable <PositiveEffectTree> GetPositiveEffectTrees() { return(EffectTreesPossible.Where(t => t is PositiveEffectTree).Cast <PositiveEffectTree>()); }
public IEnumerable <SideEffectTree> GetSideEffectTrees() { return(EffectTreesPossible.Where(t => t is SideEffectTree).Cast <SideEffectTree>()); }
public IEnumerable <EffectTree> GetemptyTrees() { return(EffectTreesPossible.Where(t => t is EmptyEffectTree)); }