public void LimitTime(RegulationType regulation, string userId, int amount) { var service = this.GetService(regulation) as ITimeLimitable; if (service != null) { service.LimitPerMonth(userId, amount); } else { Console.WriteLine($"Action restricted for this regulation ${regulation.ToString()}"); } }
public void SelfExclude(RegulationType regulation, string userId, int amount) { var service = this.GetService(regulation) as ISelfExcludable; if (service != null) { service.SelfExclude(userId, amount); } else { Console.WriteLine($"Action restricted for this regulation ${regulation.ToString()}"); } }
public void LimitBetAmount(RegulationType regulation, string userId, decimal amount) { var service = this.GetService(regulation) as IBettingLimitable; if (service != null) { service.LimitPerDay(userId, amount); } else { Console.WriteLine($"Action restricted for this regulation: {regulation.ToString()}"); } }