public UserMover(IUserRetriever userRetriever, IUserEnergyCalculator userEnergyCalculator, IUserSaver userSaver, IDistanceCalculator distanceCalculator)
 {
     _userRetriever = userRetriever;
     _userEnergyCalcualtor = userEnergyCalculator;
     _userSaver = userSaver;
     _distanceCalculator = distanceCalculator;
 }
 public UserMoveDirector(IUserRetriever userRetriever, IUserEnergyProvider userEnergyCalculator, IUserSaver userSaver, IDistanceCalculator distanceCalculator, IUserCountsSaver userCountsSaver)
 {
     _userRetriever = userRetriever;
     _userEnergyCalcualtor = userEnergyCalculator;
     _userSaver = userSaver;
     _distanceCalculator = distanceCalculator;
     _userCountsSaver = userCountsSaver;
 }
 public UserCreationService(IUserRetriever userRetriever, IUserSaver userSaver, IUserItemSaver userItemSaver, ISafeHouseItemSaver safeHouseItemSaver, IHotZoneRetriever hotZoneRetriever, IUserCountsSaver userCountsSaver)
 {
     _userRetriever = userRetriever;
     _userSaver = userSaver;
     _userItemSaver = userItemSaver;
     _safeHouseItemSaver = safeHouseItemSaver;
     _hotZoneRetriever = hotZoneRetriever;
     _userCountsSaver = userCountsSaver;
 }
 public ItemUsageDirector(IUserRetriever userRetriever, IItemRetriever itemRetriever, IUserItemSaver userItemSaver, IUserItemRetriever userItemRetriever, IUserSaver userSaver, IUserEnergyProvider userEnergyProvider, IUserSightRadiusProvider userSightRadiusProvider)
 {
     _userRetriever = userRetriever;
     _itemRetriever = itemRetriever;
     _userItemSaver = userItemSaver;
     _userItemRetriever = userItemRetriever;
     _userSaver = userSaver;
     _userEnergyProvider = userEnergyProvider;
     _userSightRadiusProvider = userSightRadiusProvider;
 }
Exemple #5
0
 public UserApiController(IUserSaver userSaver,
                          IUserDataFinder userDataFinder,
                          IDataRemover dataRemover,
                          IUserValidator userValidator)
 {
     _userSaver      = userSaver;
     _userDataFinder = userDataFinder;
     _dataRemover    = dataRemover;
     _userValidator  = userValidator;
 }
 public ZombiePacksController()
 {
     _zombiePackRetriever = MvcApplication.DependancyInjection.Resolve<IZombiePackRetriever>();
     _userZombiePackProgressUpdater = MvcApplication.DependancyInjection.Resolve<IUserZombiePackProgressSaver>();
     _userZombiePackProgressRetriever = MvcApplication.DependancyInjection.Resolve<IUserZombiePackProgressRetriever>();
     _userSaver = MvcApplication.DependancyInjection.Resolve<IUserSaver>();
     _huntDirector = MvcApplication.DependancyInjection.Resolve<IHuntDirector>();
     _zombiePackDifficultyDirector = MvcApplication.DependancyInjection.Resolve<IZombiePackDifficultyDirector>();
     _userRetriever = MvcApplication.DependancyInjection.Resolve<IUserRetriever>();
 }
        /// <summary>
        /// Initializes a new instance of the UserLevelService class.
        /// </summary>
        public UserLevelService(IUserRetriever userRetriever, IUserStatsRetriever userStatsRetriever, IUserSaver userSaver)
        {
            _userRetriever = userRetriever;
            _userStatsRetriever = userStatsRetriever;
            _userSaver = userSaver;

            _magicInventorySlotNumber = 30;
            _magicAttackPowerNumber = .9;
            _magicEnergyNumber = 1086; 
            _magicZombieNumber = 2.95154499;
        }
        public when_saving_user()
        {
            _userSaver = DalTestContextSpecification.Instance.Resolve<IUserSaver>();
            _connectionString = DalTestContextSpecification.ConnectionString;

            _idToUse = Guid.NewGuid();

            _currentHotZone = Guid.NewGuid();
            _newHotZoneIdToUse = Guid.NewGuid();

            _newHotZoneLatitude = 2.5;
            _newHotZoneLongitude = 2.5;
        }
Exemple #9
0
        public DalTestContextSpecification()
        {
            LocationRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            MeetingScheduler  = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            MeetingRetriever  = new MeetingRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            UserRetriever     = new UserRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);
            UserSaver         = new UserRepository(ConfigurationManager.ConnectionStrings["RyanLaptop"].ConnectionString);

            //LocationRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //MeetingScheduler = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //MeetingRetriever = new MeetingRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //UserRetriever = new UserRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
            //UserSaver = new UserRepository(ConfigurationManager.ConnectionStrings["Ryan7DMS"].ConnectionString);
        }
 public ShopDirector(IUserRetriever userRetriever,
     IItemRetriever itemRetriever,
     IStoreRetriever storeRetriever,
     IUserItemRetriever userItemRetriever,
     IUserSaver userSaver,
     IUserItemSaver userItemSaver)
 {
     _userRetriever = userRetriever;
     _itemRetriever = itemRetriever;
     _storeRetriever = storeRetriever;
     _userItemRetriever = userItemRetriever;
     _userSaver = userSaver;
     _userItemSaver = userItemSaver;
 }
        private static void ResolveDI()
        {
            _nodeCreator = UndeadEarth.Console.DependancyInjection.Instance.Resolve<INodeCreator>();
            _hotZoneRetriever = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IHotZoneRetriever>();
            _userCreationService = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserCreationService>();
            _userRetriever = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserRetriever>();
            _userMover = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserMoveDirector>();
            _userSaver = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserSaver>();
            _userEnergyProvider = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserEnergyProvider>();
            _huntDirector = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IHuntDirector>();
            _zombiePackRetriever = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IZombiePackRetriever>();
            _userZombiePackProgressRetriever = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserZombiePackProgressRetriever>();
            _userStatsRetriever = UndeadEarth.Controllers.DependancyInjection.Instance.Resolve<IUserStatsRetriever>();

        }
 public ZombiePackDifficultyDirector(IUserRetriever userRetriever,
     IZombiePackRetriever zombiePackRetriever,
     IUserZombiePackProgressRetriever userZombiePackRetriever,
     IUserSaver userSaver,
     IRandomNumberProvider randomNumberProvider,
     IUserPotentialProvider userPotentialProvider,
     IUserZombiePackProgressSaver userZombiePackProgressSaver,
     IUserStatsRetriever userStatsRetriever)
 {
     _userRetriever = userRetriever;
     _zombiePackRetriever = zombiePackRetriever;
     _userZombiePackProgressRetriever = userZombiePackRetriever;
     _userSaver = userSaver;
     _randomNumberProvider = randomNumberProvider;
     _userPotentialProvider = userPotentialProvider;
     _userZombiePackProgressSaver = userZombiePackProgressSaver;
     _userStatsRetriever = userStatsRetriever;
 }
        public UsersController()
        {
            _zombiePackRetriever = MvcApplication.DependancyInjection.Resolve<IZombiePackRetriever>();
            _hotZoneRetriever = MvcApplication.DependancyInjection.Resolve<IHotZoneRetriever>();
            _userRetriever = MvcApplication.DependancyInjection.Resolve<IUserRetriever>();
            _userSaver = MvcApplication.DependancyInjection.Resolve<IUserSaver>();
            _userHotZoneProgressRetriever = MvcApplication.DependancyInjection.Resolve<IUserZombiePackProgressRetriever>();
            _userItemRetriever = MvcApplication.DependancyInjection.Resolve<IUserItemRetriever>();

            _distanceCalculator = MvcApplication.DependancyInjection.Resolve<IDistanceCalculator>();
            _userEnergyProvider = MvcApplication.DependancyInjection.Resolve<IUserEnergyProvider>();
            _userMover = MvcApplication.DependancyInjection.Resolve<IUserMoveDirector>();
            _shopDirector = MvcApplication.DependancyInjection.Resolve<IShopDirector>();
            _userAttackPowerProvider = MvcApplication.DependancyInjection.Resolve<IUserAttackPowerProvider>();
            _userSightRadiusProvider = MvcApplication.DependancyInjection.Resolve<IUserSightRadiusProvider>();
            _itemUsageDirector = MvcApplication.DependancyInjection.Resolve<IItemUsageDirector>();
            _achievementProvider = MvcApplication.DependancyInjection.Resolve<IAchievementProvider>();
            _userLevelService = MvcApplication.DependancyInjection.Resolve<IUserLevelService>();
            _userCountsRetriever = MvcApplication.DependancyInjection.Resolve<IUserCountsRetriever>();
        }
Exemple #14
0
        private async Task <IUser> GetUser()
        {
            IUser         user;
            IEmailAddress emailAddress = null;

            using (ILifetimeScope scope = _container.BeginLifetimeScope())
            {
                string               subscriber          = User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value;
                IUserFactory         userFactory         = scope.Resolve <IUserFactory>();
                IEmailAddressFactory emailAddressFactory = scope.Resolve <IEmailAddressFactory>();
                SettingsFactory      settingsFactory     = scope.Resolve <SettingsFactory>();
                user = await userFactory.GetByReferenceId(settingsFactory.CreateAccount(_settings.Value), subscriber);

                if (user == null)
                {
                    string email = User.Claims.First(c => c.Type == ClaimTypes.Email).Value;
                    emailAddress = await emailAddressFactory.GetByAddress(settingsFactory.CreateAccount(_settings.Value), email);

                    if (emailAddress == null)
                    {
                        emailAddress = emailAddressFactory.Create(email);
                        IEmailAddressSaver emailAddressSaver = scope.Resolve <IEmailAddressSaver>();
                        await emailAddressSaver.Create(settingsFactory.CreateAccount(_settings.Value), emailAddress);
                    }
                    user      = userFactory.Create(subscriber, emailAddress);
                    user.Name = User.Claims.First(c => string.Equals(c.Type, "name", StringComparison.OrdinalIgnoreCase)).Value;
                    SetSuperUser(user);
                    IUserSaver userSaver = scope.Resolve <IUserSaver>();
                    await userSaver.Create(settingsFactory.CreateAccount(_settings.Value), user);
                }
                else
                {
                    user.Name = User.Claims.First(c => string.Equals(c.Type, "name", StringComparison.OrdinalIgnoreCase)).Value;
                    SetSuperUser(user);
                    IUserSaver userSaver = scope.Resolve <IUserSaver>();
                    await userSaver.Update(settingsFactory.CreateAccount(_settings.Value), user);
                }
            }
            return(user);
        }
 public HuntDirector(IUserRetriever userRetriever,
     IZombiePackRetriever zombiePackRetriever,
     IUserEnergyProvider userEnergyProvider,
     IUserSaver userSaver,
     IUserZombiePackProgressSaver userZombiePackProgressSaver,
     IUserAttackPowerProvider userAttackPowerProvider,
     IZombiePackDifficultyDirector zombiePackDifficultyDirector,
     IRandomNumberProvider randomNumberProvider,
     IUserLevelService userLevelService,
     IUserCountsSaver userCountsSaver,
     IHotZoneRetriever hotZoneRetriever)
 {
     _userRetriever = userRetriever;
     _zombiePackRetriever = zombiePackRetriever;
     _userEnergyProvider = userEnergyProvider;
     _userSaver = userSaver;
     _userZombiePackProgressSaver = userZombiePackProgressSaver;
     _userAttackPowerProvider = userAttackPowerProvider;
     _zombiePackDifficultyDirector = zombiePackDifficultyDirector;
     _randomNumberProvider = randomNumberProvider;
     _userLevelService = userLevelService;
     _userCountsSaver = userCountsSaver;
     _hotZoneRetriever = hotZoneRetriever;
 }
 public when_saving_user_sight_radius()
 {
     _userSaver = DalTestContextSpecification.Instance.Resolve<IUserSaver>();
     _connectionString = DalTestContextSpecification.ConnectionString;
     _userId = Guid.NewGuid();
 }
 public void TestInitialize()
 {
     _userSaver = new UserRepository(DalTestContextSpecification.ConnectionString);
 }
 public UserEnergyAndSightProvider(IUserRetriever userRetriever, IUserSaver userSaver, IUserItemRetriever userItemRetriever)
 {
     _userRetriever = userRetriever;
     _userSaver = userSaver;
     _userItemRetriever = userItemRetriever;
 }
 public UserEnergyCalculator(IUserRetriever userRetriever, IUserSaver userSaver)
 {
     _userRetriever = userRetriever;
     _userSaver = userSaver;
 }