コード例 #1
0
        public ConditionDataProvider(IConditionDataJsonProvider provider, IConditionDataSerializationProvider serializationProvider)
        {
            this.provider = provider;
            this.serializationProvider = serializationProvider;

            conditions       = serializationProvider.DeserializeConditionData <ConditionJsonData>(provider.GetConditionsJson());
            conditionSources = serializationProvider.DeserializeConditionData <ConditionSourcesJsonData>(provider.GetConditionSourcesJson());
            conditionGroups  = serializationProvider.DeserializeConditionData <ConditionGroupsJsonData>(provider.GetConditionGroupsJson());
        }
コード例 #2
0
        public ConditionDataProvider(IConditionDataJsonProvider provider,
                                     IConditionDataSerializationProvider serializationProvider,
                                     ICurrentCoreVersion currentCoreVersion)
        {
            this.provider = provider;
            this.serializationProvider = serializationProvider;

            var currentTag = currentCoreVersion.Current.Tag;

            conditions = serializationProvider
                         .DeserializeConditionData <ConditionJsonData>(provider.GetConditionsJson())
                         .Where(c => c.Tags == null || c.Tags.Contains(currentTag))
                         .ToList();
            conditionSources = serializationProvider.DeserializeConditionData <ConditionSourcesJsonData>(provider.GetConditionSourcesJson());
            conditionGroups  = serializationProvider.DeserializeConditionData <ConditionGroupsJsonData>(provider.GetConditionGroupsJson());
        }