public StatRecord Get(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            StatRecord result = null;

            _recordsById.TryGetValue(id, out result);

            return(result);
        }
        public StatRecord Get(StatDefinition definition)
        {
            if (definition == null)
            {
                return(null);
            }

            StatRecord result = null;

            _recordsByDefinition.TryGetValue(definition, out result);

            return(result);
        }
        public void Set(StatRecord record)
        {
            if (record == null || record.Definition == null || Has(record.Definition))
            {
                return;
            }

            if (!string.IsNullOrEmpty(record.Definition.Id))
            {
                _recordsById[record.Definition.Id] = record;
            }

            _recordsByDefinition[record.Definition] = record;
            records.Add(record);
        }