Example #1
0
 public GameController(IGameLoader game_load, IGameCreator game_creator, IProvinceLoader province_load, IPlayerLoader player_load)
 {
     this.game_load     = game_load;
     this.game_creator  = game_creator;
     this.province_load = province_load;
     this.player_load   = player_load;
 }
Example #2
0
        /// <summary>
        /// Load a game.
        /// </summary>
        /// <param name="directory"></param>
        public void LoadGame(string directory)
        {
            var game = GameUtil.GetGameFromPath(directory);

            switch (game)
            {
            case NFSGame.MW:
            {
                _loader = new MWLoader();
                _loader.Initialize(directory);

                break;
            }

            case NFSGame.World:
            {
                _loader = new WorldLoader();
                _loader.Initialize(directory);
                break;
            }

            default:
                throw new Exception($"Unsupported game: {game}");
            }
        }
Example #3
0
        public override void Construct()
        {
            base.Construct();

            gameLoader = Container.TryResolve <IGameLoader>();
            Assert.That(gameLoader, Is.Not.Null);
        }
Example #4
0
 public ConsoleHandler(ConsoleComponent console, IGameLoader gameLoader)
 {
     this.console    = console;
     this.gameLoader = gameLoader;
     //this.engine = engine;
     this.ConfigureConsole();
 }
 public GameService(IGameLoader gameLoaderService, IHotelService hotelService, IJailService jailService, ILotteryService lotteryService)
 {
     _gameLoaderService = gameLoaderService;
     _hotelService      = hotelService;
     _jailService       = jailService;
     _lotteryService    = lotteryService;
 }
 public GameStrategy(WindowNavigation windowNavigation, IGameLoader gameLoader, WaveStrategy waveStrategy, IResultsUIAdapter resultsUIAdapter)
 {
     this.windowNavigation = windowNavigation;
     this.gameLoader       = gameLoader;
     this.waveStrategy     = waveStrategy;
     this.resultsUIAdapter = resultsUIAdapter;
 }
Example #7
0
 public PlayerController(IProvinceLoader province_load, IPlayerLoader player_load, ISessionLoader session, IGameCreator game_creator, IGameLoader game_load)
 {
     this.province_load = province_load;
     this.session       = session;
     this.player_load   = player_load;
     this.game_creator  = game_creator;
     this.game_load     = game_load;
 }
 public GameStrategy(WindowNavigation windowNavigation, IGameLoader gameLoader, IList <IGameEndCondition> gameEndConditions, Player.Entities.Player player, DataProvider <ResourcesData> resourcesDataProvider)
 {
     this.windowNavigation      = windowNavigation;
     this.gameLoader            = gameLoader;
     this.gameEndConditions     = gameEndConditions;
     this.player                = player;
     this.resourcesDataProvider = resourcesDataProvider;
 }
Example #9
0
        /// <summary>
        ///     Loads the game based on parameters.
        /// </summary>
        /// <typeparam name="TLoadSource">Source type.</typeparam>
        /// <param name="canLoad">Object which can load the game.</param>
        /// <param name="source">Source from which we can load the game.</param>
        /// <returns>Loaded game.</returns>
        public static Game Load <TLoadSource>(IGameLoader <TLoadSource> canLoad, TLoadSource source)
        {
            byte[] serializedGame = canLoad.LoadGame(source);
            Game   game           = (Game)SerializationObjectWrapper.Deserialize(serializedGame).Value;

            game.ReconstructOriginalGraph();
            game.Refresh();
            return(game);
        }
Example #10
0
 public GameCreator(IProvinceLoader province_load, IGameLoader game_load, IPlayerLoader player_load, Settings settings, IDatabase db, IPowerLoader power_load)
 {
     this.province_load = province_load;
     this.game_load     = game_load;
     this.player_load   = player_load;
     this.settings      = settings;
     this.db            = db;
     this.power_load    = power_load;
 }
Example #11
0
		public NewGame(ISettingsLoader sl, IPlayersLoader players, IProvincesLoader provinces, IActionLoader actions, IActivePlayer active, IPowersLoader powers, ILoginSession login, IGameLoader game, IFormerPlayersLoader former)
		{
			this.sl = sl;
			this.players = players;
			this.provinces = provinces;
			this.actions = actions;
			this.active = active;
			this.powers = powers;
			this.login = login;
			this.game = game;
			this.former = former;
		}
Example #12
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            //// Create a new SpriteBatch, which can be used to draw textures.
            this.spriteBatch = new SpriteBatch(this.GraphicsDevice);
            ////
            this.graphicsEngine = new GraphicsEngine(this.spriteBatch);
            this.controller     = new ControllerUserInput();
            ITextureHandler textureHandler = new TextureHandler(this.Content);
            IPaintInterface painter        = new PaintBrush(textureHandler, this.graphicsEngine);

            this.engine = new Engine(this.controller, painter);
            ////
            this.gameLoader     = new GameLoader(new UnitOfWork(), this.engine);
            this.consoleHandler = new ConsoleHandler(this.console, this.gameLoader);
        }
Example #13
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        public MainForm()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            InitializeComponent();
            Size s = Size;

            ResizeEnd   += (sender, args) => { this.Refresh(); };
            ResizeBegin += (sender, args) => { s = Size; };
            Resize      += (sender, args) =>
            {
                int m = Math.Max(Size.Width, Size.Height);
                if (Size.Width < s.Width || Size.Height < s.Height)
                {
                    m = Math.Min(Size.Width, Size.Height);
                }
                Size = new Size(m, m + 50);
            };
            _gameLoader   = new GameLoader();
            _playerLoader = new PlayerLoader();
            LoadMainMenu();
        }
            public void UnregisterGameLoader(IGameLoader
							  gameLoader,
							  Gtk.MenuItem item)
            {
                gameLoaders.Remove (gameLoader);
                RemoveFromFileMenu (item);
            }
            public bool RegisterGameLoader(IGameLoader
							gameLoader,
							Gtk.MenuItem item)
            {
                gameLoaders.Add (gameLoader);
                return AddToMenu (menubar.fileMenuItem, item,
                          menubar.fileOpenSeparator);
            }
Example #16
0
 public MainMenuController(IAppStateManager appStateManager, IGameLoader gameLoader)
 {
     _appStateManager = appStateManager;
     _gameLoader      = gameLoader;
 }
Example #17
0
 public FactoryCore(IGameLoader gameLoader)
 {
     _gameLoader = gameLoader;
 }
Example #18
0
 public GameStateManager(IGameLoader loader)
 {
     _loader = loader;
 }
Example #19
0
 public FactoryCore(IGameLoader gameLoader)
 {
     _gameLoader = gameLoader;
 }
Example #20
0
 public static async Task <Game> LoadAsync <TLoadSource>(IGameLoader <TLoadSource> canLoad, TLoadSource source)
 {
     throw new NotImplementedException();
 }
Example #21
0
 /// <summary>
 /// Adds a job to the queue.
 /// </summary>
 /// <param name="job"></param>
 public void AddJob(IGameLoader job)
 {
     this.Jobs.Enqueue(job);
 }
Example #22
0
 /// <summary>
 /// Resets the game manager and the VFS.
 /// </summary>
 public void Reset()
 {
     _loader = null;
     VfsManager.Instance.Reset();
 }
Example #23
0
 /// <summary>
 /// Adds a job to the queue.
 /// </summary>
 /// <param name="job"></param>
 public void AddJob(IGameLoader job)
 {
     this.JobCount += job.GetTotalOperations();
     this.Jobs.Enqueue(job);
 }
Example #24
0
 public void RegisterGameLoader(IGameLoader loader)
 {
     this.gameLoaders.Add(loader);
 }