public void ResetModel() { Model.Color.color = new Color(0, 0, 0, 0); Model.IceCream.color = new Color(0, 0, 0, 0); Model.Cream.color = new Color(0, 0, 0, 0); Model.Topping.color = new Color(0, 0, 0, 0); Model.Outline.color = new Color(0, 0, 0, 0); _iceCreamIndex = new[] { -1, -1, 0, -1 }; _currentType = IceCreamType.None; }
public IceCream Create(IceCreamType type) { switch (type) { case IceCreamType.Vanilla: return(new VanillaIceCream()); } throw new ArgumentOutOfRangeException(); }
public void ButtonEvt_CreateIceCream(int index) { if (_currentType != (IceCreamType)index) { ResetModel(); } _currentType = (IceCreamType)index; Model.IceCream.sprite = TwoIceCreams[index].IceCreamSprite; Model.Outline.sprite = TwoIceCreams[index].Outline; Model.IceCream.color = new Color(255, 255, 255, 1); Model.Outline.color = new Color(255, 255, 255, 1); _iceCreamIndex[0] = index; }
public static IIceCream Create(IceCreamType type) { switch (type) { case IceCreamType.Chocolate: return(new ChocolateIceCream()); case IceCreamType.Vanilla: return(new VanillaIceCream()); case IceCreamType.Milk: return(new MilkIceCream()); default: throw new ArgumentException("Няма такъв сладолед"); } }
public static IIceCream MakeIceCream(IceCreamType iceCreamType) { IIceCream iceCream; switch (iceCreamType) { case IceCreamType.Chocolate: iceCream = new IceCreamCone(); iceCream = new ChocolateIceCreamScoop(iceCream); break; case IceCreamType.Strawberry: iceCream = new IceCreamCone(); iceCream = new StrawberryIceCreamScoop(iceCream); break; case IceCreamType.Vanilla: iceCream = new IceCreamCone(); iceCream = new VanillaIceCreamScoop(iceCream); break; case IceCreamType.BananaSplit: iceCream = new Dish(); iceCream = new Banana(iceCream); iceCream = new ChocolateIceCreamScoop(iceCream); iceCream = new StrawberryIceCreamScoop(iceCream); iceCream = new VanillaIceCreamScoop(iceCream); break; case IceCreamType.TripleDeluxe: iceCream = new IceCreamCone(); iceCream = new ChocolateIceCreamScoop(iceCream); iceCream = new StrawberryIceCreamScoop(iceCream); iceCream = new VanillaIceCreamScoop(iceCream); break; default: iceCream = new IceCreamCone(); break; } return(iceCream); }