Setup object for ToyWorld
        public GameControllerTestBase()
        {
            var tmxMemoryStream = FileStreams.SmallTmx();
            var tilesetTableMemoryStream = FileStreams.TilesetTableStream();

            var tilesetTableStreamReader = new StreamReader(tilesetTableMemoryStream);

            var gameSetup = new GameSetup(tmxMemoryStream, tilesetTableStreamReader);

            GameController = GetController(gameSetup);

            GameController.Init();
        }
 protected override GameControllerBase GetController(GameSetup gameSetup)
 {
     return ControllerFactory.GetThreadSafeController(gameSetup);
 }
 protected virtual GameControllerBase GetController(GameSetup gameSetup)
 {
     return ControllerFactory.GetController(gameSetup);
 }
Esempio n. 4
0
 public static GameControllerBase GetController(GameSetup gameSetup)
 {
     return new BasicGameController(new ToyWorldRenderer(), gameSetup);
 }
 public BasicGameController(ToyWorldRenderer renderer, GameSetup gameSetup)
     : base(renderer, gameSetup)
 { }
Esempio n. 6
0
 public static GameControllerBase GetThreadSafeController(GameSetup gameSetup)
 {
     return new ThreadSafeGameController(new ToyWorldRenderer(), gameSetup);
 }
Esempio n. 7
0
 public static IGameController GetGameController(GameSetup gameSetup)
 {
     return ControllerFactory.GetController(gameSetup);
 }
Esempio n. 8
0
 public static IGameController GetThreadSafeGameController(GameSetup gameSetup)
 {
     return ControllerFactory.GetThreadSafeController(gameSetup);
 }
Esempio n. 9
0
 public static GameControllerBase GetController(GameSetup gameSetup)
 {
     return(new BasicGameController(new ToyWorldRenderer(), gameSetup));
 }
Esempio n. 10
0
 public static GameControllerBase GetThreadSafeController(GameSetup gameSetup)
 {
     return(new ThreadSafeGameController(new ToyWorldRenderer(), gameSetup));
 }
Esempio n. 11
0
        private void TryToyWorld()
        {
            if (GameCtrl != null)
                GameCtrl.Dispose(); // Should dispose RRs and controllers too

            GameSetup setup = new GameSetup(
                    new FileStream(SaveFile, FileMode.Open, FileAccess.Read, FileShare.Read),
                    new StreamReader(TilesetTable));
            GameCtrl = GameFactory.GetThreadSafeGameController(setup);
            GameCtrl.Init();
        }