public Memento(ILabyrinthFactory factory, IPlayfield playfield, IPlayer player, IGameDialog dialogs, IScoreboard scoreboard, int numberOfMoves)
 {
     this.Factory = factory;
     this.Playfield = playfield;
     this.Player = player;
     this.Dialogs = dialogs;
     this.Scoreboard = scoreboard;
     this.NumberOfMoves = numberOfMoves;
 }
 private LabyrinthEngine()
 {
     this.factory = new LabyrinthFactory();
     this.playfield = this.factory.CreatePlayfield();
     this.player = this.factory.CreatePlayer();
     this.dialogs = this.factory.CreateDialogs();
     this.scoreboard = this.factory.CreateScoreboard();
     this.save = new SaveSystem();
 }
 public TestObjectsFactory()
 {
     this.factory    = new LabyrinthFactory();
     this.playfield  = this.factory.CreatePlayfield();
     this.player     = this.factory.CreatePlayer();
     this.dialogs    = this.factory.CreateDialogs();
     this.scoreboard = this.factory.CreateScoreboard();
     this.save       = new SaveSystem();
 }
 private LabyrinthEngine()
 {
     this.factory    = new LabyrinthFactory();
     this.playfield  = this.factory.CreatePlayfield();
     this.player     = this.factory.CreatePlayer();
     this.dialogs    = this.factory.CreateDialogs();
     this.scoreboard = this.factory.CreateScoreboard();
     this.save       = new SaveSystem();
 }
 public void LoadMemento(Memento restore)
 {
     Console.WriteLine("\nRestoring state --\n");
     this.factory = restore.Factory;
     this.playfield = restore.Playfield;
     this.player = restore.Player;
     this.dialogs = restore.Dialogs;
     this.scoreboard = restore.Scoreboard;
     this.numberOfMoves = restore.NumberOfMoves;
 }
 public void TestMemento()
 {
     ILabyrinthFactory factory    = new LabyrinthFactory();
     IPlayfield        playfield  = factory.CreatePlayfield();
     IPlayer           player     = factory.CreatePlayer();
     IGameDialog       dialogs    = factory.CreateDialogs();
     IScoreboard       scoreboard = factory.CreateScoreboard();
     int     numberOfMoves        = 5;
     Memento testMemento          = new Memento(factory, playfield, player, dialogs, scoreboard, numberOfMoves);
 }
 public void LoadMemento(Memento restore)
 {
     Console.WriteLine("\nRestoring state --\n");
     this.factory       = restore.Factory;
     this.playfield     = restore.Playfield;
     this.player        = restore.Player;
     this.dialogs       = restore.Dialogs;
     this.scoreboard    = restore.Scoreboard;
     this.numberOfMoves = restore.NumberOfMoves;
 }
        public void TestLoadMememntoMethod()
        {
            ILabyrinthFactory factory    = new LabyrinthFactory();
            IPlayfield        playfield  = factory.CreatePlayfield();
            IPlayer           player     = factory.CreatePlayer();
            IGameDialog       dialogs    = factory.CreateDialogs();
            IScoreboard       scoreboard = factory.CreateScoreboard();
            int     numberOfMoves        = 5;
            Memento testMemento          = new Memento(factory, playfield, player, dialogs, scoreboard, numberOfMoves);

            Labyrinth.Engine.LabyrinthEngine.Instance.LoadMemento(testMemento);
        }
 public Memento(ILabyrinthFactory factory, IPlayfield playfield, IPlayer player, IGameDialog dialogs, IScoreboard scoreboard, int numberOfMoves)
 {
     this.Factory       = factory;
     this.Playfield     = playfield;
     this.Player        = player;
     this.Dialogs       = dialogs;
     this.Scoreboard    = scoreboard;
     this.NumberOfMoves = numberOfMoves;
 }
        public void Update(IPlayer player, IPlayfield playfield, int numberOfMoves, IScoreboard scoreboard, IGameDialog dialogs)
        {
            if (playfield.IsPlayerWinning(player))
            {
                Console.Write(dialogs.WinnerMessage(numberOfMoves));
                string name = Console.ReadLine();
                try
                {
                    scoreboard.AddTopScoreToScoreboard(name, numberOfMoves);
                }
                finally
                {

                }
                Console.WriteLine();
                LabyrinthEngine.Instance.StartNewGame();
            }
        }
 public TestObjectsFactory()
 {
     this.factory = new LabyrinthFactory();
     this.playfield = this.factory.CreatePlayfield();
     this.player = this.factory.CreatePlayer();
     this.dialogs = this.factory.CreateDialogs();
     this.scoreboard = this.factory.CreateScoreboard();
     this.save = new SaveSystem();
 }
 public void Update(IPlayer player, IPlayfield playfield, int numberOfMoves, IScoreboard scoreboard, IGameDialog dialogs)
 {
     if (playfield.IsPlayerWinning(player))
     {
         Console.Write(dialogs.WinnerMessage(numberOfMoves));
         string name = Console.ReadLine();
         try
         {
             scoreboard.AddTopScoreToScoreboard(name, numberOfMoves);
         }
         finally
         {
         }
         Console.WriteLine();
         LabyrinthEngine.Instance.StartNewGame();
     }
 }