Exemple #1
0
        public void InitGame()
        {
            //var game = Control.Instance;

            //this.visualization.PrintStartMessage();

            //var labyrinth = game.Setup.SetupNewLabyrinth();
            //game.State.IsInitialized = true;

            IObjectFactory       instanceFactory = new ObjectFactory();
            Labyrinth            labyrinth       = new Labyrinth(LabyrinthSize, LabyrinthSize, instanceFactory);
            GameObjectsGenerator generator       = new GameObjectsGenerator();

            generator.GenerateObjectsNew(labyrinth);

            this.visualization.PrintMessage("Labyrinth is Ready");


            this.visualization.DrawLabyrinth(labyrinth);
            MovesFactory movesFactory = new MovesFactory(labyrinth);

            while (!labyrinth.State.IsFinished)
            {
                IMoves move = this.visualization.GetUserCommand(movesFactory);
                move.Move();
                this.visualization.DrawLabyrinth(labyrinth);
            }
        }
Exemple #2
0
        public void DoeMove()
        {
            Random r = new Random(DateTime.Now.Second);

            HuidigeMove = Moves[r.Next(0, Moves.Count)];
            Score      += HuidigeMove.Move();
        }
Exemple #3
0
 public bool DoeMove()
 {
     if (Moves.Count != 0)
     {
         Random rnd = new Random();
         move          = Moves[rnd.Next(Moves.Count)];
         aantalPunten += move.Move();
         return(true);
     }
     return(false);
 }
Exemple #4
0
 public void SetHuidigeMove()
 {
     if (rand.Next(0, 4) == 0 && Moves.Count > 0)
     {
         int number = rand.Next(Moves.Count);
         HuidigeMove     = Moves[number];
         BehaaldePunten += HuidigeMove.Move();
         return;
     }
     HuidigeMove = null;
 }
Exemple #5
0
        public int Move()
        {
            int totalScore = 0;

            if (Random.Next(0, 4) == 0 && Moves.Count > 0)
            {
                HuidigeMove = Moves[Random.Next(0, Moves.Count)];
                totalScore += HuidigeMove.Move();
            }
            else
            {
                HuidigeMove = null;
            }
            Score += totalScore;

            return(totalScore);
        }