Ejemplo n.º 1
0
        public void SetupForTest()
        {
            // Start an orange tree
            int age    = 0;
            int height = 6;

            orangeTree = new OrangeTree(age, height);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Rectangle rectangle = new Rectangle();
            int       area;

            rectangle.SetHeight(6);
            rectangle.SetWidth(7);
            area = rectangle.getArea();
            Console.WriteLine("总面积:" + area);
            Console.WriteLine("油漆总价:" + rectangle.getCost(area));

            //调用子类
            AppleTree appleTree = new AppleTree("苹果树");
            string    amyName   = appleTree.MyFruitName();

            //调用子类
            OrangeTree orangeTree = new OrangeTree("桔子树");
            string     omyName    = orangeTree.MyFruitName();

            Console.ReadKey();
        }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     OT = new OrangeTree(0, 6);
     Menu();
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Maakt de blok aan
        /// </summary>
        /// <param name="id">Afhankelijk van de id zullen we een bepaalde blok aanmaken</param>
        /// <param name="content">ContentManager object dat we gebruiken om textures te laden</param>
        /// <returns>De aangemaakt blok</returns>
        protected override GameObject CreateBlock(int id, ContentManager content)
        {
            GameObject b = null;

            if (id == 1)
            {
                b = new DirtBlock(content, "01");
            }
            else if (id == 2)
            {
                b = new GrassTopBlock(content, "04");
            }
            else if (id == 3)
            {
                b = new GrassRightBLock(content, "08");
            }
            else if (id == 4)
            {
                b = new LeftTopCornerBlock(content, "03");
            }
            else if (id == 5)
            {
                b = new RightTopCornerBlock(content, "02");
            }
            else if (id == 6)
            {
                b = new AcidMudLeftAndBottomBlock(content, "19");
            }
            else if (id == 7)
            {
                b = new AcidMudBottomBlock(content, "15");
            }
            else if (id == 8)
            {
                b = new AcidMudRightAndBottomBlock(content, "22");
            }
            else if (id == 9)
            {
                b = new GrassLeftBlock(content, "07");
            }
            else if (id == 10)
            {
                b = new LeftBottomCornerBlock(content, "10");
            }
            else if (id == 11)
            {
                b = new RightBottomCornerBlock(content, "09");
            }
            else if (id == 12)
            {
                b = new PlatformBlock(content, "plate1");
            }
            else if (id == 13)
            {
                b = new BoxFirstVariant(content, "box1");
            }
            else if (id == 14)
            {
                b = new BoxSecondVariant(content, "box2");
            }
            else if (id == 15)
            {
                b = new Scarecrow(content, "scarecrow");
            }
            else if (id == 16)
            {
                b = new Pointer(content, "pointer");
            }
            else if (id == 17)
            {
                b = new OrangeTree(content, "tree1");
            }
            else if (id == 18)
            {
                b = new YellowTree(content, "tree2");
            }
            else if (id == 19)
            {
                b = new MovingBlock(content, "plate1");
            }
            else if (id == 20)
            {
                b = new MovingBlock(content, "plate1")
                {
                    Invert = true
                }
            }
            ;
            else if (id == 21)
            {
                b = new StarCollectable(content, "star");
            }
            else if (id == 22)
            {
                b = new BouncingAcidBall(content, "LavaFireballSprite");
            }
            else if (id == 23)
            {
                b = new UpUnderBlock(content, "bovenonder");
            }
            else if (id == 24)
            {
                b = new LeftOverRoofBlock(content, "linksoverkaping");
            }
            else if (id == 25)
            {
                b = new RightOverRoofBlock(content, "rechtsoverkaping");
            }
            else if (id == 26)
            {
                b = new UnderBlock(content, "13");
            }
            else if (id == 27)
            {
                b = new FullBlock(content, "11");
            }
            else if (id == 30)
            {
                b = new GreenGoblin(content, "GreenGoblinSprite");
            }
            else if (id == 31)
            {
                b = new Giant(content, "GiantSprite");
            }
            else if (id == 32)
            {
                b = new Orc(content, "BlackGoblin");
            }
            else if (id == 33)
            {
                b = new BlueGoblin(content, "BlueMonster");
            }
            else if (id == 40)
            {
                b = new InvisibleBlock(content, "legeBlok");
            }
            else if (id == 50)
            {
                b = new ButtonNextLevel(content, "button");
            }
            return(b);
        }