예제 #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));
 }
예제 #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));
        }
예제 #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());
        }
예제 #4
0
 public BeerUser UpdateBeerUserAddExperienceAndMoney(BeerUser beerUser, Weapon weapon)
 {
     BeerCalculationService.AddExperience(beerUser, weapon);
     beerUser.Money += 10;
     return(_context.UpdateBeerUser(beerUser));
 }
예제 #5
0
 public void UpdateBeerUserCharacteristics(BeerUser beerUser, Weapon weapon)
 {
     BeerCalculationService.CharacteristicsCalculation(beerUser, weapon);
     _context.UpdateBeerUser(beerUser);
 }