public void CheckForUser(User user) { if (user.IsArmyCostLimitExceeded(currentCost)) { throw ArmyException.CreateCostLimitExceeded(); } }
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(); }