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); } }
public void DoeMove() { Random r = new Random(DateTime.Now.Second); HuidigeMove = Moves[r.Next(0, Moves.Count)]; Score += HuidigeMove.Move(); }
public bool DoeMove() { if (Moves.Count != 0) { Random rnd = new Random(); move = Moves[rnd.Next(Moves.Count)]; aantalPunten += move.Move(); return(true); } return(false); }
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; }
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); }