public GetCurrentCharacterForAccountHandler(ICharacterService characterService, IUserService userService,
                                             IMapper mapper)
 {
     _characterService = characterService;
     _userService      = userService;
     _mapper           = mapper;
 }
Ejemplo n.º 2
0
        public void Update()
        {
            if (characterService.Character.Position == doorPos)
            {
                OnTheDoor = true;
            }

            if (services.Count == 0)
            {
                map.IsClear = true;
                doorMeshes.ForEach(m => m.IsVisible = true);
            }
            ICharacterService service = servicesQueue.Peek();

            if (!service.Character.IsActive || !service.Character.IsAlive)
            {
                servicesQueue.Dequeue();
                if (servicesQueue.Count != 0)
                {
                    servicesQueue.Peek().Character.IsActive = true;
                }
                else
                {
                    UpdateQueue();
                }
            }
            else
            {
                service.Update();
            }
            for (int i = 0; i < pickUps.Count; i++)
            {
                if (!pickUps[i].IsExist)
                {
                    pickUps.Remove(pickUps[i]);
                }
            }
            for (int i = 0; i < staticObjects.Count; i++)
            {
                if (!staticObjects[i].IsAlive)
                {
                    Cell cell = map[staticObjects[i].Position].Value;
                    cell.Unit       = Unit.Empty;
                    cell.UnitObject = null;
                    map[staticObjects[i].Position] = cell;
                    staticObjects.Remove(staticObjects[i]);
                }
            }
            for (int i = 0; i < services.Count; i++)
            {
                if (!services[i].Character.IsAlive)
                {
                    Cell cell = map[services[i].Character.Position].Value;
                    cell.Unit       = Unit.Empty;
                    cell.UnitObject = null;
                    map[services[i].Character.Position] = cell;
                    services.Remove(services[i]);
                }
            }
        }
 public DecreaseCharacterBalanceHandler(IUserService userService, ICharacterService characterService,
     IUnitOfWork unitOfWork)
 {
     _userService = userService;
     _characterService = characterService;
     _unitOfWork = unitOfWork;
 }
Ejemplo n.º 4
0
        public Mutation(IEpisodeService episodeService, ICharacterService characterService)
        {
            Name = "Mutation";

            Field <EpisodeType>(
                "addEpisode",  // name of this mutation
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <AddEpisodeRequest> > {
                Name = _episodeArgumentName
            }),                                                                                                                         // Arguments
                resolve: context =>
            {
                // Get Argument
                var addEpisodeRequest = context.GetArgument <AddEpisodeRequest>(_episodeArgumentName);
                // Create new Episode and return the object
                var episode = new Episode {
                    episodeTitle = addEpisodeRequest.Name, episodeDescription = addEpisodeRequest.Description
                };
                return(episodeService.Create(episode));
            }
                );

            Field <CharacterType>(
                "killCharacter",  // name of this mutation
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <KillCharacterRequest> > {
                Name = _killCharacterArgumentName
            }),                                                                                                                                  // Arguments
                resolve: context =>
            {
                // Get Argument
                var killRequest = context.GetArgument <KillCharacterRequest>(_killCharacterArgumentName);
                // Update the character
                return(characterService.Kill(killRequest.characterName, killRequest.killedBy));
            }
                );
        }
Ejemplo n.º 5
0
 public CharacterDelete(IServiceProvider serviceProvider, Packet packet, GameClient client) : base(serviceProvider)
 {
     _client               = client;
     _characterService     = serviceProvider.GetService <ICharacterService>();
     _characterCrudService = serviceProvider.GetService <ICrudService <CharacterContract> >();
     _charSlot             = packet.ReadInt();
 }
 public CharactersController(
     UserManager <WowGuildManagerUser> userManager,
     ICharacterService characterService)
 {
     this.userManager      = userManager;
     this.characterService = characterService;
 }
Ejemplo n.º 7
0
 public PlayerHourlyLoadoutsController(IDbContextHelper dbContextHelper, IProfileService profileService, ICharacterService characterService, IFactionService factionService)
 {
     _dbContextHelper  = dbContextHelper;
     _profileService   = profileService;
     _characterService = characterService;
     _factionService   = factionService;
 }
        public PlayerLeaderboardController(IDbContextHelper dbContextHelper, ICharacterService characterService, PlayerLoginMemoryCache loginCache)
        {
            _dbContextHelper  = dbContextHelper;
            _characterService = characterService;

            _loginCache = loginCache.Cache;
        }
Ejemplo n.º 9
0
 public QuizService(IQuizAsyncRepository quizRepo, ICharacterAsyncRepository characterRepo, ICharacterService characterService, IMapper mapper)
 {
     _quizRepo         = quizRepo;
     _characterRepo    = characterRepo;
     _characterService = characterService;
     _mapper           = mapper;
 }
Ejemplo n.º 10
0
 public ItemsViewModel()
 {
     characterService = new CharacterService();
     Title            = "Who GOT killed?";
     Items            = new ObservableCollection <Character>();
     LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());
 }
Ejemplo n.º 11
0
 public CharactersController(ICharacterRepository repository, IEpisodeRepository episodeRepository, IMapper mapper, ICharacterService characterService)
 {
     _characterRepository = repository;
     _episodeRepository   = episodeRepository;
     _mapper           = mapper;
     _characterService = characterService;
 }
Ejemplo n.º 12
0
 public ItemDetailViewModel(Character item = null)
 {
     ShowInfo         = false;
     characterService = new CharacterService();
     Title            = item?.characterName;
     Item             = item;
 }
Ejemplo n.º 13
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>();
        }
Ejemplo n.º 14
0
 public TavernController(ILocationService locationService, IAccountService accountService, ICharacterService characterService, IMapper mapper)
 {
     this.locationService  = locationService;
     this.accountService   = accountService;
     this.characterService = characterService;
     this.mapper           = mapper;
 }
Ejemplo n.º 15
0
 public CharacterController(ICharacterService characterService, ILogger <CharacterController> logger, IMapper mapper, ProducerEventBus eventBus)
 {
     _logger           = logger;
     _mapper           = mapper;
     _eventBus         = eventBus;
     _characterService = characterService;
 }
        public PlayerDetailsController(ICharacterService characterService, IDbContextHelper dbContextHelper, PlayerLoginMemoryCache loginCache)
        {
            _characterService = characterService;
            _dbContextHelper  = dbContextHelper;

            _loginCache = loginCache.Cache;
        }
Ejemplo n.º 17
0
        public ApiUpdaterService(ILogger <ApiUpdaterService> logger,
                                 IPlayerService playerService,
                                 IPlayerRepository playerRepository,
                                 ICharacterRepository characterRepository,
                                 ICharacterService characterService,
                                 ISkillRepository skillRepository,
                                 ISkillService skillService,
                                 ICraftableService craftableService,
                                 ICraftableRepository craftableRepository,
                                 IBondService bondService,
                                 IBondRepository bondRepository,
                                 ICharacterSkillService characterSkillService,
                                 ICharacterSkillRepository characterSkillRepository)
        {
            _logger = logger;

            _playerService       = playerService;
            _playerRepository    = playerRepository;
            _characterService    = characterService;
            _characterRepository = characterRepository;
            _skillService        = skillService;
            _skillRepository     = skillRepository;
            _itemService         = craftableService;
            _itemRepository      = craftableRepository;
            _bondRepository      = bondRepository;
            _bondService         = bondService;
            _charSkillService    = characterSkillService;
            _charSkillRepository = characterSkillRepository;
        }
Ejemplo n.º 18
0
 public CharacterFacade(IUnitOfWorkProvider unitOfWorkProvider, ICharacterService characterService,
                        IAttributesService attributesService, IEquipmentService equipmentService, IInventoryService inventoryService) : base(unitOfWorkProvider)
 {
     _characterService  = characterService;
     _attributesService = attributesService;
     _equipmentService  = equipmentService;
 }
Ejemplo n.º 19
0
 public CharacterController(IAccountService accountService, ICharacterService characterService, ICommandDispatcher commandDispatcher)
     : base(commandDispatcher)
 {
     _accountService    = accountService;
     _characterService  = characterService;
     _commandDispatcher = commandDispatcher;
 }
Ejemplo n.º 20
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                var items = await ICharacterService.GetAll();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 21
0
 public DormController(IStatsService statsService, IAccountService accountService, IItemService itemService, ICharacterService characterService, IMapper mapper)
 {
     this.statsService     = statsService;
     this.accountService   = accountService;
     this.itemService      = itemService;
     this.characterService = characterService;
     this.mapper           = mapper;
 }
Ejemplo n.º 22
0
 public QueryPlayerAvatarModelEventListener(IEntityCreationFinishedEventSubscribable subscriptionService,
                                            [NotNull] IReadonlyEntityGuidMappable <IEntityDataFieldContainer> entityDataContainer,
                                            [NotNull] ICharacterService characterService)
     : base(subscriptionService)
 {
     EntityDataContainer = entityDataContainer ?? throw new ArgumentNullException(nameof(entityDataContainer));
     CharacterService    = characterService ?? throw new ArgumentNullException(nameof(characterService));
 }
Ejemplo n.º 23
0
        public CharactersController(ICharacterService characterService, IMapper mapper)
        {
            Guard.WhenArgument(characterService, nameof(characterService)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();

            this.characterService = characterService;
            this.mapper           = mapper;
        }
Ejemplo n.º 24
0
 public CharacterController(IValidator <Character> characterValidator, ICharacterService characterService, IGameRepository gameRepository, ICharacterRepository characterRepository)
 {
     _characterService    = characterService;
     _gameRepository      = gameRepository;
     _characterRepository = characterRepository;
     _characterValidator  = characterValidator;
     _mapper = new Mapper();
 }
Ejemplo n.º 25
0
 public AccountService(SignInManager <Player> signInManager, RoleManager <IdentityRole> roleManager, ICharacterService characterService, IStatsService statsService, IInventoryService inventoryService)
 {
     this.signInManager    = signInManager;
     this.roleManager      = roleManager;
     this.characterService = characterService;
     this.statsService     = statsService;
     this.inventoryService = inventoryService;
 }
Ejemplo n.º 26
0
 public Query(ICharacterService characterService, IEpisodeService episodeService)
 {
     Name = "Query";
     // Expose characters
     Field <ListGraphType <CharacterType> >("characters", resolve: (context) => characterService.GetAll());
     // Expose episodes
     Field <ListGraphType <EpisodeType> >("episodes", resolve: (context) => episodeService.GetAll());
 }
Ejemplo n.º 27
0
 public CharacterController(ICharacterService characterService,
                            ITokenService tokenService,
                            IMapper mapper)
 {
     _characterService = characterService;
     _tokenService     = tokenService;
     _mapper           = mapper;
 }
 public CharacterDetailController(LfContext context, ICharacterService characterService, LfContext lfContext,
                                  UserManager <AppUser> userManager, ApplicationDbContext appDbContext)
 {
     _context          = context;
     _characterService = characterService;
     _userManager      = userManager;
     _appDbContext     = appDbContext;
 }
Ejemplo n.º 29
0
 public CharacterController(ICharacterService characterService, ILogger logger, IPowerService powerService, IPowerLevelService powerLevelService, ITemplateService templateService)
 {
     _characterService = characterService;
     _powerService = powerService;
     _powerLevelService = powerLevelService;
     _templateService = templateService;
     _logger = logger;
 }
Ejemplo n.º 30
0
 public SolarSystemNoteController(IMapper mapper,
                                  ICharacterService characterService,
                                  ISolarSystemNoteService solarSystemNoteService)
 {
     _mapper                 = mapper;
     _characterService       = characterService;
     _solarSystemNoteService = solarSystemNoteService;
 }
 public GetWeaponsForCurrentCharacterHandler(IUserService userService, ICharacterService characterService,
                                             IWeaponService weaponService, IMapper mapper)
 {
     _userService      = userService;
     _characterService = characterService;
     _weaponService    = weaponService;
     _mapper           = mapper;
 }
 public CharacterController(ICharacterService charService)
 {
     characterService = charService;
 }
Ejemplo n.º 33
0
        private void InjectionInitialize(
            ICharacterService characterService,
            IComicService comicService,
            ICreatorService creatorService,
            ISeriesService seriesService,
            IEventService eventService,
            ILoadingManager loadingManager,
            IScreenManager screenManager,
            IEventManager eventManager,
            IResultProcessor resultProcessor,
            IPlanetSystemSpawner planetSystemSpawner,
            SearchViewModel searchViewModel)
        {
            this.characterService = characterService;
            this.comicService = comicService;
            this.creatorService = creatorService;
            this.seriesService = seriesService;
            this.eventService = eventService;

            this.loadingManager = loadingManager;
            this.screenManager = screenManager;
            this.eventManager = eventManager;
            this.resultProcessor = resultProcessor;
            this.planetSystemSpawner = planetSystemSpawner;

            this.searchViewModel = searchViewModel;

            this.eventManager.GetEvent<LoadingEvent>().AddListener(this.OnLoading);
        }
Ejemplo n.º 34
0
 private void InjectionInitialize(
     ICharacterService characterService)
 {
     this.characterService = characterService;
 }
Ejemplo n.º 35
0
 public CorpController(ICharacterService characterService)
 {
     _characterService = characterService;
 }
Ejemplo n.º 36
0
 //
 // GET: /PLayer/
 public PlayerController(IAchievementService achievementService, ICharacterService characterService)
 {
     _achievementService = achievementService;
     _characterService = characterService;
 }