Exemplo n.º 1
0
        public static EventRepository GetRepository(ContextMap contextMap)
        {
            IEventConditionRepository eventConditionRepository = new EventConditionRepository(contextMap);
            IEventContentsRepository  eventContentsRepository  = new EventContentsRepository(contextMap);
            IRewardRepository         rewardRepository         = new RewardRepository(contextMap);

            return(new EventRepository(contextMap, eventConditionRepository, eventContentsRepository, rewardRepository));
        }
Exemplo n.º 2
0
        private void Start()
        {
            // コンテキストマップ
            ContextMap.Initialize();
            PlayerContextMap.Initialize();

            // レポジトリ
            var onegaiRepository                       = OnegaiRepository.GetRepository(ContextMap.DefaultMap);
            var eventRepository                        = EventRepository.GetRepository(ContextMap.DefaultMap);
            var monoInfoRepository                     = new MonoInfoRepository(ContextMap.DefaultMap);
            var mousePurchaceTableRepository           = new MousePurchaceTableRepository(ContextMap.DefaultMap);
            var conversationRepository                 = new ConversationRepository(ContextMap.DefaultMap);
            var rewardRepository                       = new RewardRepository(ContextMap.DefaultMap);
            var appearCharacterRepository              = new AppearCharacterRepository(ContextMap.DefaultMap);
            var playerOnegaiRepository                 = PlayerOnegaiRepository.GetRepository(ContextMap.DefaultMap, PlayerContextMap.DefaultMap);
            var playerEventRepository                  = PlayerEventRepository.GetRepository(ContextMap.DefaultMap, PlayerContextMap.DefaultMap);
            var playerMonoInfoRepository               = PlayerMonoInfoRepository.GetRepository(ContextMap.DefaultMap, PlayerContextMap.DefaultMap);
            var playerMouseStockRepository             = new PlayerMouseStockRepository(PlayerContextMap.DefaultMap);
            var playerMonoViewRepository               = new PlayerMonoViewRepository(monoInfoRepository, PlayerContextMap.DefaultMap);
            var playerArrangementTargetRepository      = new PlayerArrangementTargetRepository(monoInfoRepository, playerMonoViewRepository, PlayerContextMap.DefaultMap);
            var playerMouseViewRepository              = new PlayerMouseViewRepository(playerArrangementTargetRepository, PlayerContextMap.DefaultMap);
            var playerInfoRepository                   = new PlayerInfoRepository(PlayerContextMap.DefaultMap);
            var playerAppearCharacterReserveRepository = new PlayerAppearCharacterReserveRepository(appearCharacterRepository, conversationRepository, rewardRepository, PlayerContextMap.DefaultMap);
            var playerAppearCharacterViewRepository    = new PlayerAppearCharacterViewRepository(playerAppearCharacterReserveRepository, PlayerContextMap.DefaultMap);

            // ゲームのコンテキストマップ
            GameContextMap.Initialize(playerArrangementTargetRepository);

            // instance
            this.inputManager         = new InputManager();
            this.wallet               = new Wallet(new Currency(0), playerInfoRepository);                            // 所持金の初期値も外出ししたい
            this.arrangementItemStore = new ArrangementItemStore(new ArrangementItemAmount(0), playerInfoRepository); // 所持アイテムの初期値も外出ししたい
            this.arrangementManager   = new ArrangementManager(this.rootObject, playerOnegaiRepository, playerArrangementTargetRepository);
            this.monoManager          = new MonoManager(this.rootObject, playerMonoViewRepository);
            this.effectManager        = new EffectManager(mainCamera, rootEffectUI);
            this.gameModeManager      = new GameModeManager();
            this.gameModeManager.EnqueueChangeModeWithHistory(GameModeGenerator.GenerateSelectMode());
            this.fieldRaycastManager = new FieldRaycastManager(this.mainCamera);
            //            this.mouseSelectManager = new MouseSelectManager();
            this.monoSelectManager                 = new MonoSelectManager();
            this.timeManager                       = new TimeManager(playerInfoRepository);
            this.mouseHomeManager                  = new MouseHomeManager(this.rootObject);
            this.onegaiHomeManager                 = new OnegaiHomeManager(this.rootObject);
            this.mouseStockManager                 = new MouseStockManager(this.rootObject, playerMouseStockRepository, playerMouseViewRepository);
            this.dailyActionManager                = new DailyActionManager();
            this.eventManager                      = new EventManager(playerEventRepository);
            this.constantlyEventPusher             = new ConstantlyEventPusher(playerOnegaiRepository);
            this.appearCharacterManager            = new AppearCharacterManager(this.rootObject, playerAppearCharacterViewRepository);
            this.dailyAppearCharacterRegistManager = new DailyAppearCharacterRegistManager(playerAppearCharacterReserveRepository);
            this.onegaiMediaterManager             = new OnegaiMediaterManager(playerOnegaiRepository);
            this.onegaiManager                     = new OnegaiManager(playerOnegaiRepository);
            this.monoReleaseManager                = new MonoReleaseManager(playerMonoInfoRepository);
            this.reserveAmountManager              = new ReserveAmountManager();
            this.cameraMoveManager                 = new CameraMoveManager(this.mainCamera.transform);

            // initialize
            this.arrangementPresenter.Initialize(playerArrangementTargetRepository);
            this.gameUIManager.Initialize(onegaiRepository, playerOnegaiRepository, monoInfoRepository, playerMonoInfoRepository, mousePurchaceTableRepository, playerMouseStockRepository);
            this.mouseHomeManager.Initialize();
            this.onegaiHomeManager.Initialize();
            this.inputManager.Initialize();

            // Service
            var initializePlayerInfoService = new InitializePlayerInfoService(playerInfoRepository);

            initializePlayerInfoService.Execute();
            var onegaiUnLockService = new OnegaiUnLockService(onegaiRepository, playerOnegaiRepository);

            onegaiUnLockService.Execute();
            var onegaiUnLockChacheService = new OnegaiUnLockChacheService(playerOnegaiRepository);

            onegaiUnLockChacheService.Execute();
            var eventUnLockService = new EventUnLockService(eventRepository, playerEventRepository);

            eventUnLockService.Execute();
            var initialArrangementService = new InitialArrangementService(playerArrangementTargetRepository);

            initialArrangementService.Execute();
            var initializeOrderedMouseService = new InitializeOrderedMouseService(playerMouseViewRepository);

            initializeOrderedMouseService.Execute();
            var initializeAppearCharacterService = new InitializeAppearCharacterService(playerAppearCharacterReserveRepository, playerAppearCharacterViewRepository);

            initializeAppearCharacterService.Execute();
        }