Example #1
0
        public bool Apply(Playerstatistic playerstatistic)
        {
            var result = (DataFreshness == 0 || (DateTime.Now - playerstatistic.Time).Days <= DataFreshness) &&
                         (TableTypes == null || !TableTypes.Any() || TableTypes.Contains(playerstatistic.MaxPlayers));

            return(result);
        }
Example #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashcode = 23;
                hashcode += hashcode * 31 + DataFreshness.GetHashCode();

                if (TableTypes != null && TableTypes.Any())
                {
                    TableTypes.Distinct().ForEach(x =>
                    {
                        hashcode += hashcode * 31 + x.GetHashCode();
                    });
                }

                return(hashcode);
            }
        }