Esempio n. 1
0
        public void DispenseCans()
        {
            Cola       Cola     = new Cola();//Need to change names. Similarity to class is confusing.
            RootBeer   RootBeer = new RootBeer();
            OrangeSoda Orange   = new OrangeSoda();

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>();
                register.Add("Cola");
                Console.WriteLine(index);
                int balanceOfCola = index;
            }

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>(); //List<string> register = new List<string>();
                register.Add("Root Beer");            //How do spaces in list names affect the system?
                Console.WriteLine(index);
                int balanceOfRootBeer = index;
            }

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>();
                register.Add("Orange");
                Console.WriteLine(index);
                int balanceOfOrange = index;
            }
            Console.WriteLine();
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var rootBeer = new RootBeer(this);

            if (rootBeer.IsRooted)
            {
                //we found indication of root
            }

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;
        }
        public bool?IsRooted()
        {
            var rootBeer = new RootBeer(Application.Context);

            return(rootBeer.IsRooted);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            #region Soda

            var colas = new Cola(210);
            colas.Flavours.Add(new VanillaCola(215));
            colas.Flavours.Add(new CherryCola(210));

            var lemonLime = new LemonLime(185);

            var rootBeers = new RootBeer(195);
            rootBeers.Flavours.Add(new VanillaRootBeer(200));
            rootBeers.Flavours.Add(new StrawberryRootBeer(200));

            SodaWater sodaWater = new SodaWater(180);
            sodaWater.Flavours.Add(colas);
            sodaWater.Flavours.Add(lemonLime);
            sodaWater.Flavours.Add(rootBeers);

            sodaWater.DisplayCalories(0);

            #endregion

            #region Family

            // Parent 1
            Person john = new Person("John");
            // Parent 2
            Person jane = new Person("Jane");

            // Child 1
            Person alice = new Person("Alice");
            // Child 2
            Person billy = new Person("Billy");
            // Child 3
            Person christine = new Person("Christine");

            // John and Jane are both parents of Alice
            john.AddChild(alice);
            jane.AddChild(alice);

            // John is also Billy's parent
            john.AddChild(billy);

            // Jane is also Christine's parent
            jane.AddChild(christine);

            // Since David is John's brother he is also an uncle.
            Uncle david = new Uncle("David");

            // David and John are both the children of their father Edward.
            Person edward = new Person("Edward");
            edward.AddChild(john);
            // Even though 'david' is class of Uncle it can still be added
            // as a child.
            edward.AddChild(david);

            #endregion

            Console.ReadKey();
        }