public void AddChallenge(Challenge challenge) { if (Challenges.Any(c => c.Date.Date == DateTime.Today)) { throw new ArgumentException("A challenge has already been chosen for today."); } Challenges.Add(challenge); challenge.Name = $"Challenge {Challenges.Count}"; if (Challenges.Count == 1) { StartedAt = DateTime.Now; } }
public void AddChallenge(Challenge challenge) { if (Challenges.Any(c => (c.TimeToAccept > 0 && c.Done == false))) { throw new ArgumentException("A challenge has already been chosen for today."); } Challenges.Add(challenge); challenge.Name = $"Challenge {Challenges.Count}"; if (Challenges.Count == 1) { StartedAt = DateTime.Now; } BadgeSigner.Instance.RewardBadges(this, challenge); }