示例#1
0
        static void Main(string[] args)
        {
            var miniFigure = new MiniFigure();

            miniFigure.Head = new YodaHead
            {
                EyeColor     = "Brown",
                HairColor    = "Blue",
                HasNose      = false,
                MouthIsOpen  = true,
                NumberOfEyes = 3,
            };

            var fatHead = new FatHead();

            fatHead.Talk();
            miniFigure.Head.Think();

            switch (miniFigure.Head)
            {
            case YodaHead h:
                h.Battle();
                break;
            }

            //fatHead.Size = HeadSize.Small;
        }
示例#2
0
        static void Main(string[] args)
        {
            var minifigure = new Minifigure();
            minifigure.Head = new YodaHead
            {
                EyeColor = "Blue",
                HairColor = "Black",

            var fatHead = new FatHead();

            fatHead.Talk();
            minifigure.Head.Think();
        }
    }
示例#3
0
        static void Main(string[] args)
        {
            var minifigure = new Minifigure();

            minifigure.Head = new YodaHead
            {
                EyeColor     = "Brown",
                HairColor    = "Blue",
                HasNose      = false,
                MouthIsOpen  = true,
                NumberOfEyes = 3
            };

            var fatHead = new FatHead();

            fatHead.Talk();
            minifigure.Head.Think();
        }
示例#4
0
        static void Main(string[] args)
        {
            var newHead = new YodaHead
            {
                EyeColor     = "Brown",
                HairColor    = "Blue",
                HasNose      = true,
                MouthIsOpen  = true,
                NumberOfEyes = 2
            };

            var newLegs = new CentaurLegs()
            {
            }


            var minifigure = new Minifigure(newHead);

            minifigure.Battle();

            var fatHead = new FatHead();

            fatHead.Talk();
            minifigure.Head.Talk();
            Console.WriteLine(fatHead.EyeColor, "this is eye color");


            var vaderHead = new VaderHead
            {
                EyeColor     = "Brown",
                HairColor    = "Blue",
                HasNose      = true,
                MouthIsOpen  = true,
                NumberOfEyes = 2
            };
            var newminifigure = new Minifigure(vaderHead);
        }