示例#1
0
        static void Main(string[] args)
        {
            Blat Italian = Blat.Italian;
            Blat Regular = Blat.Regular;
            //PizzaBase b1 = new PizzaBase(Italian, 10);

            PizzaBase b1 = new PizzaBase(Regular, 10);

            PizzaTopping top1 = new PizzaTopping("BUfallo Mozarella");

            top1.Cost = 2.5;

            PizzaTopping top2 = new PizzaTopping("Salami");

            top2.Cost = 4;
            top2.Name = top2.Name.ToUpper();

            PizzaTopping top3 = new PizzaTopping("Tomatoes");

            top3.Cost = 2;

            Pizza P1 = new Pizza(b1);

            P1.Name = "QuatroStagioni";
            P1.AddTopping(top1);
            P1.AddTopping(top2);
            P1.Print();

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Blat Italian = Blat.Italian;
            Blat Regular = Blat.Regular;

            PizzaBase    b1   = new PizzaBase(Regular, 7);
            PizzaTopping top1 = new PizzaTopping("Goat Mozzarela", 2.5);
            PizzaTopping top2 = new PizzaTopping("Deer skin", 17.00);
            PizzaTopping top3 = new PizzaTopping("Horse radish", 7);

            Pizza p1 = new Pizza(b1);

            p1.Name = "Quatro Useless";
            p1.AddTopping(top1);
            p1.AddTopping(top2);
            p1.Print();

            Console.ReadLine();
        }
示例#3
0
        //Name(Can be: Regular, Thick, Italian)
        //Cost
        //Print();
        //PizzaBase should be passed as parameter to constructor.
        // Italian PizzaBase should cost 1.5 * Base Cost.

        public PizzaBase(Blat name, double cost)
        {
            this.Name = name;
            this.Cost = cost;
        }
示例#4
0
 public PizzaBase(Blat name, double cost)
 {
     Name = name;
     Cost = cost;
 }