Beispiel #1
0
 public void UpdateUserWeaponInUse(UserWeapon userWeapon)
 {
     if (userWeapon.Weapon.MinimumLevel > userWeapon.User.Level)
     {
         throw new BeerException("You do not have the enough level yet !");
     }
     _context.UpdateUserWeaponInUse(userWeapon);
     UpdateBeerUserInformations(BeerCalculationService.CharacteristicsCalculation(userWeapon.User, userWeapon.Weapon));
 }
Beispiel #2
0
        public void UpdateUserWeaponInUse(int userWeaponId)
        {
            var userWeapon = GetUserWeaponById(userWeaponId);

            if (userWeapon == null)
            {
                throw new BeerException("Can't find the weapon !");
            }
            UpdateUserWeaponInUse(userWeapon);
            UpdateBeerUserInformations(BeerCalculationService.CharacteristicsCalculation(userWeapon.User, userWeapon.Weapon));
        }
Beispiel #3
0
        public List <BeerUser> GetAllBeerUsers()
        {
            // Update characteristics of all gamers.
            var beerUsers = _context.GetAllBeerUsers();

            foreach (var u in beerUsers)
            {
                UpdateBeerUserInformations(BeerCalculationService.CharacteristicsCalculation(u, GetUserWeaponInUse(u).Weapon));
            }

            return(_context.GetAllBeerUsers());
        }
Beispiel #4
0
 public void UpdateBeerUserCharacteristics(BeerUser beerUser, Weapon weapon)
 {
     BeerCalculationService.CharacteristicsCalculation(beerUser, weapon);
     _context.UpdateBeerUser(beerUser);
 }