Example #1
0
 internal void LoadCore(GameObjectRepo gameObjectRepo,
     HandlerHub handlerHub,
     GameMenuControls gameMenuControls,
     OptionMenuControls optionMenuControls,
     GeneralControls generalControls,
     Func<GameState> oldGameStateFunc,
     Func<GameState> newGameStateFunc)
 {
     var coreInstaller = new CoreModuleInstaller(gameObjectRepo, gameMenuControls, optionMenuControls, generalControls, oldGameStateFunc, newGameStateFunc, handlerHub);
     coreInstaller.Install(handlerHub);
 }
Example #2
0
        internal void LoadCore(GameObjectRepo gameObjectRepo,
                               HandlerHub handlerHub,
                               GameMenuControls gameMenuControls,
                               OptionMenuControls optionMenuControls,
                               GeneralControls generalControls,
                               Func <GameState> oldGameStateFunc,
                               Func <GameState> newGameStateFunc)
        {
            var coreInstaller = new CoreModuleInstaller(gameObjectRepo, gameMenuControls, optionMenuControls, generalControls, oldGameStateFunc, newGameStateFunc, handlerHub);

            coreInstaller.Install(handlerHub);
        }
Example #3
0
        private void Start()
        {
            _handlerHub = new HandlerHub();
            _gameObjectRepo = new GameObjectRepo();
            var gameMenuControls = new GameMenuControls();
            var optionMenuControls = new OptionMenuControls();
            var generalControls = new GeneralControls();


            _moduleModuleManager.LoadCore(_gameObjectRepo, _handlerHub, gameMenuControls, optionMenuControls, generalControls, () => _oldGameState, () => _newGameState);
            _moduleModuleManager.LoadModules(_handlerHub);

            var startUpHandler = new StartUpHandler(generalControls);

            startUpHandler.SpecificHandle(_oldGameState, _newGameState);
        }
Example #4
0
 public CoreModuleInstaller(GameObjectRepo gameObjectRepo,
                            GameMenuControls gameMenuControls,
                            OptionMenuControls optionMenuControls,
                            GeneralControls generalControls,
                            Func <GameState> oldGameStateFunc,
                            Func <GameState> newGameStateFunc,
                            HandlerHub handlerHub
                            ) : base("Core")
 {
     _gameObjectRepo     = gameObjectRepo;
     _gameMenuControls   = gameMenuControls;
     _optionMenuControls = optionMenuControls;
     _generalControls    = generalControls;
     _oldGameStateFunc   = oldGameStateFunc;
     _newGameStateFunc   = newGameStateFunc;
     _handlerHub         = handlerHub;
 }
Example #5
0
 public CoreModuleInstaller(GameObjectRepo gameObjectRepo,
     GameMenuControls gameMenuControls,
     OptionMenuControls optionMenuControls,
     GeneralControls generalControls,
     Func<GameState> oldGameStateFunc,
     Func<GameState> newGameStateFunc,
     HandlerHub handlerHub
     )
     : base("Core")
 {
     _gameObjectRepo = gameObjectRepo;
     _gameMenuControls = gameMenuControls;
     _optionMenuControls = optionMenuControls;
     _generalControls = generalControls;
     _oldGameStateFunc = oldGameStateFunc;
     _newGameStateFunc = newGameStateFunc;
     _handlerHub = handlerHub;
 }
Example #6
0
 internal void LoadModules(HandlerHub handlerHub)
 {
     var workingDirectory = Environment.CurrentDirectory;
     var modulesDir = Path.Combine(workingDirectory, "/Modules/");
     foreach (var module in _modules.Where(x => x.Key != "Core"))
     {
         var assembly = Assembly.LoadFile(module.Value.Config.PathToAssembly);
         var moduleInstallers = assembly.GetTypes().Where(x => x.IsSubclassOf(typeof(ModuleInstaller))).ToArray();
         if (moduleInstallers.Length > 1)
         {
             Logger.AppendLine($"You can only have 1 ModuleInstaller per Assembly. Name:{module.Key}");
             continue;
         }
         else if (moduleInstallers.Length == 0)
         {
             Logger.AppendLine($"You have no ModuleInstallers in the {module.Key} Assembly");
         }
         //TODO: Do actual module loading
     }
 }
Example #7
0
        internal void LoadModules(HandlerHub handlerHub)
        {
            var workingDirectory = Environment.CurrentDirectory;
            var modulesDir       = Path.Combine(workingDirectory, "/Modules/");

            foreach (var module in _modules.Where(x => x.Key != "Core"))
            {
                var assembly         = Assembly.LoadFile(module.Value.Config.PathToAssembly);
                var moduleInstallers = assembly.GetTypes().Where(x => x.IsSubclassOf(typeof(ModuleInstaller))).ToArray();
                if (moduleInstallers.Length > 1)
                {
                    Logger.AppendLine($"You can only have 1 ModuleInstaller per Assembly. Name:{module.Key}");
                    continue;
                }
                else if (moduleInstallers.Length == 0)
                {
                    Logger.AppendLine($"You have no ModuleInstallers in the {module.Key} Assembly");
                }
                //TODO: Do actual module loading
            }
        }
 public CreateSettingsButtonInGameMenuHandler(GameMenuControls gameMenuControls, GeneralControls generalControls, HandlerHub handlerHub)
 {
     _gameMenuControls = gameMenuControls;
     _generalControls  = generalControls;
     _handlerHub       = handlerHub;
 }
Example #9
0
 public GameStateDifferHandler(HandlerHub handlerHub)
 {
     _handlerHub = handlerHub;
 }
Example #10
0
 public GameStateDifferHandler(HandlerHub handlerHub)
 {
     _handlerHub = handlerHub;
 }