public override IVeggie GetVeggie(VeggieType veggieType) { switch (veggieType) { case VeggieType.Carrot: IVeggie carrot = new Carrot(); return(carrot); case VeggieType.Broccoli: IVeggie broccoli = new Broccoli(); return(broccoli); case VeggieType.Potato: IVeggie potato = new Potato(); return(potato); } return(null); }
public override IVeggie GetVeggie(VeggieType veggieType) { return(null); }
public abstract IVeggie GetVeggie(VeggieType veggieType);
public bool HasVeggie(VeggieType veggie) => _veggies.Contains(veggie);
public bool CanAddVeggie(VeggieType veggie) => !HasVeggie(veggie);