Exemplo n.º 1
0
        public void InitGame()
        {
            mwContext.GameGrid.Children.Clear();
            Tigers.Clear();
            Bulls.Clear();
            for (int i = 0; i < 2; ++i)
            {
                for (int j = 0; j < 4; ++j)
                {
                    Board[i, j] = new Cell(this, i, j, Animal.Bull);
                    Bulls.Add(Board[i, j]);
                }
            }

            for (int i = 1; i < 3; ++i)
            {
                Board[4, i] = new Cell(this, 4, i, Animal.Tiger);
                Tigers.Add(Board[4, i]);
            }
            for (int i = 2; i < 4; ++i)
            {
                for (int j = 0; j < 4; ++j)
                {
                    Board[i, j] = new Cell(this, i, j);
                }
            }
            Board[4, 0] = new Cell(this, 4, 0);
            Board[4, 3] = new Cell(this, 4, 3);

            MoveCounter           = 0;
            mwContext.DataContext = null;
            mwContext.DataContext = this;
            mwContext.ShowBoard();
        }
Exemplo n.º 2
0
        public Safari()
        {
            graphics = new GraphicsDeviceManager(this);
            //graphics.PreferredBackBufferWidth = 1366;
            //graphics.PreferredBackBufferHeight = 768;
            //graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            // Komponenten erstellen
            camera = new FreeLookCamera(this);
            ground = new Ground(this);
            lights = new Lights(this);
            skybox = new Skybox(this);
            tigers = new Tigers(this);
            cubes  = new Cubes(this);
            ray    = new Line(this);

            cameraTracker = new CameraTracker(this, camera);
            cameraHandler = new CameraHandler(this, camera);

            // Komponenten zur Liste hinzufügen
            Components.Add(cameraTracker);
            Components.Add(cameraHandler);
            Components.Add(camera);
            Components.Add(skybox);
            Components.Add(lights);
            Components.Add(tigers);
            Components.Add(ground);
            Components.Add(cubes);
            Components.Add(ray);

            // Services zur Liste hinzufügen
            Services.AddService(typeof(ICameraService), camera);
            Services.AddService(typeof(ILightService), lights);

            // Antialiasing aktivieren
            graphics.PreferMultiSampling = true;
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Blackbear blackBear = new Blackbear();

            Console.WriteLine("============BLACK BEAR============");
            Console.WriteLine(blackBear.EatsMeat());
            Console.WriteLine($"Black Bears are at the zoo {blackBear.IsAtTheZoo}");
            Console.WriteLine($"Black Bears eat plants and meat {blackBear.Omnivore}");

            Tigers tigers = new Tigers();

            Console.WriteLine("============TIGERS============");
            Console.WriteLine($"Tigers don't have tails {tigers.HasStrips}");
            Console.WriteLine($"Tigers are not considered King of the Jungle {tigers.KingOfTheJungle()}");
            Console.WriteLine($"Tigers are domestic {tigers.Domestic}");

            Kodiak kodiak = new Kodiak();

            Console.WriteLine("============KODIAK============");
            Console.WriteLine(kodiak.EatsMeat());
            Console.WriteLine($"Kodiaks {kodiak.Carnivore}");
            Console.WriteLine($"Kodiaks Don't Have a Tail { kodiak.CanStand}");

            Grizzley grizzley = new Grizzley();

            Console.WriteLine("============GRIZZLEY============");
            Console.WriteLine(grizzley.EatsMeat());
            Console.WriteLine($"Grizzlies Do hibernate {grizzley.Hibernates}");
            Console.WriteLine($"Grizzlies Do { grizzley.HasTail }");


            Lions lions = new Lions();

            Console.WriteLine("============LIONS============");
            Console.WriteLine($"Lions eat meals {lions.Meals}");
            Console.WriteLine($"Lions are domestic {lions.Domestic}");
            Console.WriteLine($"Lions have stripes {lions.HasStrips}");
        }
Exemplo n.º 4
0
        public void TigersIsAnAnimal()
        {
            Tigers tigers = new Tigers();

            Assert.True(tigers is Felines);
        }
Exemplo n.º 5
0
        public void TigersKingOfTheJungle()
        {
            Tigers tigers = new Tigers();

            Assert.True(tigers.KingOfTheJungle());
        }
Exemplo n.º 6
0
        public void TigerIsFelines()
        {
            Tigers tigers = new Tigers();

            Assert.True(tigers is Felines);
        }