public void Init()
        {
            var       machine = new HotDrinkMachine();
            IHotDrink drink   = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 2
0
        static void RunAbstractFactory()
        {
            HotDrinkMachine machine = new HotDrinkMachine();
            IHotDrink       drink   = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100);

            drink.Consume();
        }
Esempio n. 3
0
        private static void AbstractFactoryWithOCP()
        {
            var       machine = new HotDrinkMachineWithOCP();
            IHotDrink drink   = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 4
0
        public static void Run()
        {
            var       machine = new HotDrinkMachine();
            IHotDrink drink   = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 5
0
        public AbstractFactoryDemo2()
        {
            var       machine = new HotDrinkMachine();
            IHotDrink drink   = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 6
0
        void main()
        {
            var       HotDrinkMachine = new HotDrinkMachine();
            IHotDrink mydrink         = HotDrinkMachine.MakeDrink(AvailableDrink.COFFEE, 100);

            mydrink.Consume();
        }
Esempio n. 7
0
        void main()
        {
            var       HotDrinkMachine = new HotDrinkMachine();
            IHotDrink mydrink         = HotDrinkMachine.MakeDrink(0, 100);

            mydrink.Consume();
        }
Esempio n. 8
0
        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();
        }
Esempio n. 11
0
        public static void CreateFactory()
        {
            var machine = new HotDrinkMachine();
            //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300);
            //drink.Consume();

            IHotDrink drink = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 12
0
        public static void AbstractClass()
        {
            var machine = new HotDrinkMachine();
            //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300);
            //drink.Consume();

            IHotDrink drink = machine.MakeDrink();

            drink.Consume();
        }
Esempio n. 13
0
        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();
        }
Esempio n. 14
0
        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();
        }
Esempio n. 15
0
        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();
        }
Esempio n. 16
0
    // 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));
    }
Esempio n. 17
0
        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();
        }