Пример #1
0
 public void CheckForUser(User user)
 {
     if (user.IsArmyCostLimitExceeded(currentCost))
     {
         throw ArmyException.CreateCostLimitExceeded();
     }
 }
Пример #2
0
        public Army(string ownerLogin, IEnumerable <Squad> squads)
        {
            if (string.IsNullOrEmpty(ownerLogin))
            {
                throw ArmyException.CreateEmptyOwner();
            }

            if (squads == null || !squads.Any())
            {
                throw ArmyException.CreateNoSquads();
            }

            OwnerLogin  = ownerLogin;
            this.squads = squads.ToList();
        }