Example #1
0
 public EditEnemyView(Pool pool, IViewService viewService, IEnemyService enemyService)
     : base("EditorView/Enemy/EditEnemyView")
 {
     this.pool = pool;
     this.viewService = viewService;
     this.enemyService = enemyService;
 }
Example #2
0
        public CharacterServiceTests()
        {
            var services = new ServiceCollection();

            services.AddDbContext <ApplicationDbContext>(options =>
                                                         options.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseLazyLoadingProxies());

            services.AddScoped <ICharacterService, CharacterService>();
            services.AddScoped <IInventoryItemService, InventoryItemService>();
            services.AddScoped <IInventoryService, InventoryService>();
            services.AddScoped <IItemService, ItemService>();
            services.AddScoped <ILocationService, LocationService>();
            services.AddScoped <IQuestService, QuestService>();
            services.AddScoped <IEnemyService, EnemyService>();
            services.AddScoped <IStatsService, StatsService>();

            this.provider = services.BuildServiceProvider();

            this.context = provider.GetService <ApplicationDbContext>();

            this.characterService     = provider.GetService <ICharacterService>();
            this.inventoryItemService = provider.GetService <IInventoryItemService>();
            this.inventoryService     = provider.GetService <IInventoryService>();
            this.itemService          = provider.GetService <IItemService>();
            this.locationService      = provider.GetService <ILocationService>();
            this.questService         = provider.GetService <IQuestService>();
            this.enemyService         = provider.GetService <IEnemyService>();
            this.statsService         = provider.GetService <IStatsService>();
        }
Example #3
0
        public GameController(
            Game game,
            ICollisionDetectionService collisionDetectionService,
            IPlayerService playerService,
            IEnemyService enemyService,
            IInputService inputService,
            IHeadUpDisplayService headUpDisplayService,
            ITerrainService terrainService,
            IAudioService audioService)
            : base(game)
        {
            this.game = game;

            this.collisionDetectionService = collisionDetectionService;
            this.playerService = playerService;
            this.enemyService = enemyService;
            this.inputService = inputService;
            this.headUpDisplayService = headUpDisplayService;
            this.terrainService = terrainService;
            this.audioService = audioService;

            this.inputService.AnalogPauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };
            this.inputService.PauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };

            this.fadeEffect = "FadeIn";
        }
Example #4
0
 public EnemyFactory(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, SignalBus _signalBus)
 {
     gameService  = _gameService;
     pathService  = _pathService;
     enemyService = _enemyService;
     signalBus    = _signalBus;
 }
Example #5
0
 public LevelService(FixedBlocks fixedBlockPrefab, BreakableBlocks breakableBlockPrefab,
                     IEnemyService enemyService, IPlayerService playerService)
 {
     this.playerService = playerService;
     this.playerService.SetLevelService(this);
     levelController = new LevelController(fixedBlockPrefab, breakableBlockPrefab,
                                           enemyService, playerService, this);
 }
Example #6
0
        public DogsEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, SignalBus _signalBus, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
        {
            enemyType    = EnemyType.DOGS;
            signalBus    = _signalBus;
            newDirection = spawnDirection;

            signalBus.Subscribe <NewDogDestinationSignal>(ChangeDestination);
        }
Example #7
0
 public EditLevelView(Pool pool, ILevelService levelService, IViewService viewService, IPathService pathService, IEnemyService enemyService)
     : base("EditorView/Level/EditLevelView")
 {
     this.pool = pool;
     this.levelService = levelService;
     this.viewService = viewService;
     EditLevelView.pathService = pathService;
     EditLevelView.enemyService = enemyService;
 }
Example #8
0
        // Start is called before the first frame update
        void Start()
        {
            uiController.SetServiceManager(this);
            playerService = new PlayerService(playerPrefab, bombPrefab, this);
            enemyService  = new EnemyService(enemyPrefab, this);
            levelService  = new LevelService(fixedBlock, breableBlock, enemyService, playerService);
            enemyService.SetLevelService(levelService);

            levelService.GenerateLevel();
        }
 public CollisionDetectionService(
     Game game,
     IPlayerService playerService,
     IEnemyService enemyService,
     ITerrainService terrainService)
     : base(game)
 {
     this.playerService = playerService;
     this.enemyService = enemyService;
     this.terrainService = terrainService;
 }
Example #10
0
        public AccountServiceTests()
        {
            var services = new ServiceCollection();

            services.AddDbContext <ApplicationDbContext>(options =>
                                                         options.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseLazyLoadingProxies());

            services.AddIdentity <Player, IdentityRole>(options =>
            {
                //for now
                options.SignIn.RequireConfirmedEmail    = false;
                options.Password.RequiredLength         = UserConstants.PasswordMinLength;
                options.Password.RequireNonAlphanumeric = false;
                options.Password.RequireLowercase       = false;
                options.Password.RequireUppercase       = false;
                options.Password.RequireDigit           = false;
                options.Lockout.MaxFailedAccessAttempts = 3;
                //Lockout time-а нарочно е малко ;)
                options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromSeconds(10);
            })
            //.AddDefaultUI()
            .AddDefaultTokenProviders()
            .AddEntityFrameworkStores <ApplicationDbContext>();

            services.AddScoped <SignInManager <Player>, SignInManager <Player> >();
            services.AddScoped <RoleManager <IdentityRole>, RoleManager <IdentityRole> >();
            services.AddScoped <IAccountService, AccountService>();
            services.AddScoped <ICharacterService, CharacterService>();
            services.AddScoped <IInventoryItemService, InventoryItemService>();
            services.AddScoped <IInventoryService, InventoryService>();
            services.AddScoped <IItemService, ItemService>();
            services.AddScoped <IQuestService, QuestService>();
            services.AddScoped <IEnemyService, EnemyService>();
            services.AddScoped <IStatsService, StatsService>();

            this.provider = services.BuildServiceProvider();

            this.context = provider.GetService <ApplicationDbContext>();

            this.signInManager        = provider.GetService <SignInManager <Player> >();
            this.roleManager          = provider.GetService <RoleManager <IdentityRole> >();
            this.accountService       = provider.GetService <IAccountService>();
            this.characterService     = provider.GetService <ICharacterService>();
            this.inventoryItemService = provider.GetService <IInventoryItemService>();
            this.inventoryService     = provider.GetService <IInventoryService>();
            this.itemService          = provider.GetService <IItemService>();
            this.questService         = provider.GetService <IQuestService>();
            this.enemyService         = provider.GetService <IEnemyService>();
            this.statsService         = provider.GetService <IStatsService>();
        }
 public LevelController(FixedBlocks fixedBlockPrefab, BreakableBlocks breakableBlockPrefab,
                        IEnemyService enemyService, IPlayerService playerService
                        , LevelService levelService)
 {
     this.playerService      = playerService;
     this.enemyService       = enemyService;
     this.levelService       = levelService;
     this.fixedBlockPref     = fixedBlockPrefab;
     this.breakableBlockPref = breakableBlockPrefab;
     gridWidth  = (int)ServiceManager.singleton.gridSize.x;
     gridHeight = (int)ServiceManager.singleton.gridSize.y;
     enemyCount = ServiceManager.singleton.enemyCount;
     ServiceManager.singleton.restartGame += RestartGame;
 }
Example #12
0
        public EnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int _currentNodeID, Directions _spawnDirection, bool _hasShield)
        {
            currentEnemyService   = _enemyService;
            spawnLocation         = _spawnLocation;
            enemyScriptableObject = _enemyScriptableObject;
            pathService           = _pathService;
            spawnDirection        = _spawnDirection;
            currentNodeID         = _currentNodeID;
            gameService           = _gameService;
            hasShield             = _hasShield;

            stateMachine = new EnemyStateMachine();
            SpawnEnemyView();
            PopulateDirectionList();
        }
        public EnemyServiceTests()
        {
            var services = new ServiceCollection();

            services.AddDbContext <ApplicationDbContext>(options =>
                                                         options.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseLazyLoadingProxies());

            services.AddScoped <IEnemyService, EnemyService>();
            services.AddScoped <IStatsService, StatsService>();

            this.provider = services.BuildServiceProvider();

            this.context = provider.GetService <ApplicationDbContext>();

            this.enemyService = provider.GetService <IEnemyService>();
            this.statsService = provider.GetService <IStatsService>();
        }
Example #14
0
 public GuardWithTorchEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
 {
     enemyType = EnemyType.GUARD_TORCH;
 }
Example #15
0
 public QuestService(ApplicationDbContext context, IEnemyService enemyService)
 {
     this.context      = context;
     this.enemyService = enemyService;
 }
Example #16
0
 private void createServices()
 {
     timeService = new TimeService();
     eventService = new EventService();
     uiFactoryService = new UIFactoryService();
     wwwService = new FakeWwwService();//controller.GameObject.AddComponent<WwwService>();
     viewService = new ViewService(eventService, uiFactoryService);
     loadService = new LoadService(eventService);
     gameService = new GameService(pool, viewService);
     pathService = new PathService(pool, wwwService, eventService);
     levelService = new LevelService(wwwService, eventService);
     enemyService = new EnemyService(pool, wwwService, eventService);
     bonusService = new BonusService(pool, wwwService, eventService);
     difficultyService = new DifficultyService(pool, wwwService, eventService);
     infoService = new InfoService(viewService, uiFactoryService, eventService);
     settingsService = new SettingsService(pool);
     translationService = new TranslationService(settingsService);
     languageService = new LanguageService(wwwService, eventService);
     analyticsService = new AnalyticsService(settingsService);
     shipService = new ShipService(timeService, eventService);
     gamerService = new GamerService(eventService);
     currencyService = new CurrencyService(eventService, gamerService);
     iapService = new IAPService(eventService);
     adService = new AdService(currencyService);
     shopService = new ShopService(currencyService, eventService, iapService);
     updateables.Add(infoService);
 }
 public RotatingKnifeEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
 {
     enemyType = EnemyType.ROTATING_KNIFE;
 }
Example #18
0
 public SniperEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
 {
     enemyType = EnemyType.SNIPER;
 }
Example #19
0
        private void ComposeServices()
        {
            this.terrainService = new TerrainService(
                this);

            this.headUpDisplayService = new HeadUpDisplayService(
                this);

            this.audioService = new AudioService(
                this);

            this.enemyFactory = new EnemyFactory(
                this,
                terrainService);

            this.enemyService = new EnemyService(
                this,
                enemyFactory);

            this.playerFactory = new PlayerFactory(
                this);

            this.inputService = new InputService(
                this);

            this.playerService = new PlayerService(
                this,
                inputService,
                audioService,
                playerFactory,
                terrainService);

            this.collisionDetectionService = new CollisionDetectionService(
                this,
                playerService,
                enemyService,
                terrainService);

            this.gameController = new GameController(
                this,
                collisionDetectionService,
                playerService,
                enemyService,
                inputService,
                headUpDisplayService,
                terrainService,
                audioService);

            try
            {
                var consoleAssembly = Assembly.Load("SpaceFighter.Console");
                var consoleServiceType = consoleAssembly.GetType("SpaceFighter.Console.ConsoleService");
                var consoleService = Activator.CreateInstance(consoleServiceType, this);

                this.Components.Add(consoleService as IGameComponent);
            }
            catch(FileNotFoundException)
            {
                // No console support available
            }
        }
Example #20
0
 public BiDirectionalEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
 {
     enemyType = EnemyType.BIDIRECTIONAL;
     SetSecondDirection();
 }
Example #21
0
        public async Task InvokeAsync(HttpContext context, IAccountService accountService, IItemService itemService, ILocationService locationService, IEnemyService enemyService, IQuestService questService)
        {
            await accountService.SeedRolesAsync();

            await accountService.SeedAdminAsync();

            await itemService.SeedItemsAsync();

            await locationService.SeedLocationsAsync();

            await enemyService.SeedEnemiesAsync();

            await questService.SeedQuestsAsync();

            await this.next(context);
        }
Example #22
0
 public CircularCopEnemyController(IEnemyService _enemyService, IPathService _pathService, IGameService _gameService, Vector3 _spawnLocation, EnemyScriptableObject _enemyScriptableObject, int currentNodeID, Directions spawnDirection, bool _hasShield) : base(_enemyService, _pathService, _gameService, _spawnLocation, _enemyScriptableObject, currentNodeID, spawnDirection, _hasShield)
 {
     enemyType = EnemyType.CIRCULAR_COP;
 }