예제 #1
0
        public ZombieController(CodeVsZombieProblem problem)
        {
            this.problem = problem;
            distances    = new double[problem.zombies.Length][];
            for (int i = 0; i < problem.zombies.Length; i++)
            {
                distances[i] = new double[problem.humans.Length + 1];
            }

            CalculateDistances();
        }
예제 #2
0
        public Form1()
        {
            isPaused  = true;
            isStarted = false;

            problem = new CodeVsZombieProblem();

            InitializeComponent();

            timer1.Interval = trackBar1.Value * 100;
            timer1.Tick    += new EventHandler(Update);
            timer1.Start();

            label1.Text = "Скорость хода: " + trackBar1.Value * 100 + " мс";
            label2.Text = "Проблема N0/" + (problem.amountProblems - 1);
        }
예제 #3
0
        public GameController(CodeVsZombieProblem problem)
        {
            this.problem     = problem;
            zombieController = new ZombieController(problem);
            playerController = new PlayerController(new Solution(problem.zombies, problem.humans, problem.player));

            countZombies = problem.zombies.Length;
            countHumans  = problem.humans.Length;

            numberRound      = 0;
            numberNextAction = 1;

            score = 0;

            isGameOver = false;
            isWin      = false;

            multiplier = 0;

            randomAlgorithm = new RandomAlgorithm(problem);
        }
예제 #4
0
 public Simulation(CodeVsZombieProblem problem, GameController gameController)
 {
     this.problem        = problem;
     this.gameController = gameController;
 }
예제 #5
0
 public RandomAlgorithm(CodeVsZombieProblem problem)
 {
     this.problem = problem;
     random       = new Random();
 }