Ejemplo n.º 1
0
        private Vector2D MoveAnimalToRandomLocation(HungerGamesArena arena, Animal animal)
        {
            Rectangle rect;

            do
            {
                Vector2D position = new Vector2D(ArenaEngine.Random.NextDouble(animal.Size.Width,
                                                                               arena.Width - animal.Size.Width),
                                                 ArenaEngine.Random.NextDouble(animal.Size.Height, arena.Height - animal.Size.Height));
                rect = new Rectangle(position, animal.Size.Width, animal.Size.Height);
            } while (!arena.IsValidLocation(rect));
            return(rect.Center);
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            Registry.Initialize(@"HungerGames\", @"Graphics\");

            HungerGamesArena arena = new HungerGamesArena(arenaWidth, arenaHeight);

            GameMaster master = new GameMaster(arena);

            master.AddChooser(new ChooserJayDong());
            master.AddChooser(new ChooserDefault());

            master.AddAllAnimals(nHare, nLynx);

            var sim = new HungerGamesTestWindow(new ArenaEngineAdapter(arena));

            sim.DisplayCheckBox.IsChecked = false;
            sim.Show();
        }
Ejemplo n.º 3
0
 public GameMaster(HungerGamesArena arena)
 {
     this.arena = arena;
     va         = new VisibleArena(arena);
 }