public TechnologiesController(IBuildingsService buildingsService, ITechnologiesService techService, IPlayerService playerService, ILogicProvider logic)
 {
     this.buildingsService = buildingsService;
     this.techService = techService;
     this.playerService = playerService;
     this.logic = logic;
 }
Пример #2
0
        public void Dispose()
        {
            var disposable = _provider as IDisposable;
            if (disposable != null)
                disposable.Dispose();
            _provider = null;

            disposable = _repo as IDisposable;
            if (disposable != null)
                disposable.Dispose();
            _repo = null;

            if (_crawler != null)
            {
                if (IsAsync)
                {
                    _crawler.PageCrawlStartingAsync -= crawler_ProcessPageCrawlStarting;
                    _crawler.PageCrawlCompletedAsync -= crawler_ProcessPageCrawlCompleted;
                    _crawler.PageCrawlDisallowedAsync -= crawler_PageCrawlDisallowed;
                    _crawler.PageLinksCrawlDisallowedAsync -= crawler_PageLinksCrawlDisallowed;
                }
                else
                {
                    _crawler.PageCrawlStarting -= crawler_ProcessPageCrawlStarting;
                    _crawler.PageCrawlCompleted -= crawler_ProcessPageCrawlCompleted;
                    _crawler.PageCrawlDisallowed -= crawler_PageCrawlDisallowed;
                    _crawler.PageLinksCrawlDisallowed -= crawler_PageLinksCrawlDisallowed;
                }
                _crawler = null;
            }
        }        
Пример #3
0
 public void Dispose()
 {
     var disposable = _provider as IDisposable;
     if (disposable != null)
         disposable.Dispose();
     _provider = null;
 }
Пример #4
0
        public override void OnStart()
        {
            _gameController.ShouldUpdate = true;

            _getMoreLivesLogicProvider = new GetMoreLivesLogicProvider(this, _gameEngineInterface, _gameController.DataLayer);

            EULALogicProvider = new EULALogicProvider(this, _gameEngineInterface, _gameController.DataLayer);

            _logicProvidersByState[MenuState.Loading]      = LoadingLogicProvider;
            _logicProvidersByState[MenuState.ChooseLevel]  = ChooseLevelLogicProvider;
            _logicProvidersByState[MenuState.InMenu]       = InMenuLogicProvider;
            _logicProvidersByState[MenuState.OutOfLives]   = OutOfLivesLogicProvider;
            _logicProvidersByState[MenuState.GetMoreLives] = _getMoreLivesLogicProvider;
            _logicProvidersByState[MenuState.HowToPlay]    = HowToPlayLogicProvider;
            _logicProvidersByState[MenuState.EULA]         = EULALogicProvider;


            foreach (var curKvp in _logicProvidersByState)
            {
                curKvp.Value.OnStart();
            }

            _curLogicProvider = _logicProvidersByState[(MenuState)DefaultSceneState];
            SetSceneState(DefaultSceneState);
            DefaultSceneState = (int)GetDefaultSceneState(); //reset this to the default value. Callers can set DefaultSceneState, but the valueis reset each time we reach OnStart again

            //_gameEngineInterface.LogToConsole("MenuLogHandler.Start()");

            //_curLogicProvider.LogToDebugOutput("OnStart()");

            //_curLogicProvider.LogToDebugOutput("Bundle Version Code: " + _gameEngineInterface.AppVersion); //todo real game: make this compatible with iOS too

            _gameEngineInterface.AppStoreService.LogToDebugOutput = LogToDebugOutput;
        }
Пример #5
0
 public PlayerService(IRepository<ApplicationUser> users, IRepository<Planet> planets, IRepository<Shard> shards, IRepository<PlayerObject> players, ILogicProvider logic)
 {
     this.users = users;
     this.planets = planets;
     this.shards = shards;
     this.players = players;
     this.logic = logic;
 }
Пример #6
0
 public MyScheduler(ILogicProvider provider, CrawlerRun definition, IRepository repo)
 {
     _provider  = provider;
     _repo      = repo;
     SessionId  = definition.SessionId;
     CrawlerId  = definition.CrawlerId;
     BaseDomain = definition.BaseDomain;
 }
Пример #7
0
 public MyScheduler(ILogicProvider provider, CrawlerRun definition, IRepository repo)
 {
     _provider = provider;
     _repo = repo;
     SessionId = definition.SessionId;
     CrawlerId = definition.CrawlerId;
     BaseDomain = definition.BaseDomain;
 }
Пример #8
0
 public FleetController(IPlayerService playerService, IBuildingsService buildingsService, IFleetService fleetService, ITechnologiesService techService, ILogicProvider logic, IBackgroundWorkerService<IFleetService> worker)
 {
     this.playerService = playerService;
     this.buildingsService = buildingsService;
     this.fleetService = fleetService;
     this.techService = techService;
     this.logic = logic;
     this.worker = worker;
 }
Пример #9
0
 public void Dispose()
 {
     var disposable = _provider as IDisposable;
     if (disposable != null)
         disposable.Dispose();
     _provider = null;
     //Do not dispose of the repo if it is passed in by the crawldaddy
     _repo = null;
 }   
Пример #10
0
        public void Dispose()
        {
            var disposable = _provider as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
            _provider = null;
        }
Пример #11
0
        public void Dispose()
        {
            var disposable = _provider as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
            _provider = null;
            //Do not dispose of the repo if it is passed in by the crawldaddy
            _repo = null;
        }
Пример #12
0
        public override void SetSceneState(int sceneState)
        {
            GameState gameState         = (GameState)sceneState;
            var       prevLogicProvider = _curLogicProvider;

            _curLogicProvider = _logicProvidersByGameState[gameState];

            if (prevLogicProvider != null)            //todo v2: do we need this if statement? seems like prevLogicProvider is never null
            {
                prevLogicProvider.ClearInputStates(); //we don't want old input states to still be active when we switch back to the original logic provider
                prevLogicProvider.OnDeActivate();
            }

            _curLogicProvider.OnActivate();
        }
Пример #13
0
        //todo v2: move SetSceneState into base class. This also means you have to move _curLogicProvider and _logicProvidersByGameState into the base class, and make _logicProvidersByGameState have an int key
        public override void SetSceneState(int sceneState)
        {
            MenuState menuState = (MenuState)sceneState;

            var prevLogicProvider = _curLogicProvider;

            _curLogicProvider = _logicProvidersByState[menuState];

            if (prevLogicProvider != null)
            {
                prevLogicProvider.ClearInputStates(); //we don't want old input states to still be active when we switch back to the original logic provider
                prevLogicProvider.OnDeActivate();
            }

            _curLogicProvider.OnActivate();
        }
Пример #14
0
        public void Dispose()
        {
            var disposable = _provider as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
            _provider = null;

            disposable = _repo as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
            _repo = null;

            if (_crawler != null)
            {
                if (IsAsync)
                {
                    _crawler.PageCrawlStartingAsync        -= crawler_ProcessPageCrawlStarting;
                    _crawler.PageCrawlCompletedAsync       -= crawler_ProcessPageCrawlCompleted;
                    _crawler.PageCrawlDisallowedAsync      -= crawler_PageCrawlDisallowed;
                    _crawler.PageLinksCrawlDisallowedAsync -= crawler_PageLinksCrawlDisallowed;
                }
                else
                {
                    _crawler.PageCrawlStarting        -= crawler_ProcessPageCrawlStarting;
                    _crawler.PageCrawlCompleted       -= crawler_ProcessPageCrawlCompleted;
                    _crawler.PageCrawlDisallowed      -= crawler_PageCrawlDisallowed;
                    _crawler.PageLinksCrawlDisallowed -= crawler_PageLinksCrawlDisallowed;
                }
                _crawler = null;
            }
        }
Пример #15
0
 public BuildingService(IRepository<ApplicationUser> users, ILogicProvider logic)
 {
     this.users = users;
     this.logic = logic;
 }
Пример #16
0
 public CrawlDaddy(ILogicProvider provider, IRepository repo)
 {
     _provider = provider;
     _repo = repo;
 }
Пример #17
0
 public ParsedLinksProcessor(ILogicProvider provider)
 {
     _provider = provider;
 }
Пример #18
0
 public PreviewController(IPlayerService playerService, ILogicProvider logic)
 {
     this.playerService = playerService;
     this.logic = logic;
 }
Пример #19
0
 public ParsedLinksProcessor(ILogicProvider provider)
 {
     _provider = provider;
 }
Пример #20
0
 public CrawlDaddy(ILogicProvider provider, IRepository repo)
 {
     _provider = provider;
     _repo     = repo;
 }
Пример #21
0
 public BuildingsController(IBuildingsService buildingsService, IPlayerService playerService, ILogicProvider logic)
 {
     this.buildingsService = buildingsService;
     this.playerService = playerService;
     this.logic = logic;
 }
Пример #22
0
 public TechnologiesService(IRepository<ApplicationUser> users, ILogicProvider logic)
 {
     this.users = users;
     this.logic = logic;
 }