public void Init() { var machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
static void RunAbstractFactory() { HotDrinkMachine machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100); drink.Consume(); }
private static void AbstractFactoryWithOCP() { var machine = new HotDrinkMachineWithOCP(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
public static void Run() { var machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
public AbstractFactoryDemo2() { var machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
void main() { var HotDrinkMachine = new HotDrinkMachine(); IHotDrink mydrink = HotDrinkMachine.MakeDrink(AvailableDrink.COFFEE, 100); mydrink.Consume(); }
void main() { var HotDrinkMachine = new HotDrinkMachine(); IHotDrink mydrink = HotDrinkMachine.MakeDrink(0, 100); mydrink.Consume(); }
static void RunAbstractFactoryWithOCP() { HotDrinkMachineOCP machine = new HotDrinkMachineOCP(); IHotDrink hotDrink = machine.MakeDrink(); hotDrink.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
public static void CreateFactory() { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
public static void AbstractClass() { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
public static void Start() { var machine = new HotDrinkMachine(); //// first version //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); Console.WriteLine("Hello World!"); Console.ReadKey(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); //Calls for commented code //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 2); //drink.Consume(); //var secondDrink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 5); //secondDrink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
// Use this for initialization void Start() { HotDrinkMachine machine = new HotDrinkMachine(); IHotDrink drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 120); IHotDrink drink2 = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 500); drink.Consume(); drink2.Consume(); Debug.Log(Enum.GetName(typeof(HotDrinkMachine.AvailableDrink), 0)); Debug.Log(Enum.GetName(typeof(HotDrinkMachine.AvailableDrink), 1)); }
static void Main(string[] args) { //Calling Abstract Factory Class In main var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); //var pointCartesian = Point.Factory.NewCartesianPoint(2.0, 3.0); //var pointPolar = Point.Factory.NewPolarPoint(1.0, Math.PI / 2); //Console.WriteLine(pointPolar); }
static void Main(string[] args) { // // approch 1 use //HotDrinkMachine hotDrinkMachine = new HotDrinkMachine(); //var coffee = hotDrinkMachine.MakeDrink(HotDrinkMachine.AvaliableDrink.Coffee, 500); //coffee.Consume(); // // approach 2 HotDrinkMachine hotDrinkMachine = new HotDrinkMachine(); IHotDrink hotDrink = hotDrinkMachine.MakeDrink(); hotDrink.Consume(); Console.WriteLine("Hello World!"); }
static void Main(string[] args) { //var p1 = new Point(2, 3, Point.CoordinateSystem.Cartesian); //var origin = Point.Origin; //var p2 = Point.Factory.NewCartesianPoint(1, 2); // ABSTRACT FACTORY var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); Console.ReadLine(); }