private void CalculateTier(ConditionalDefinition <T> definition) { ConditionalTier <T>[] tiers = definition.Tiers; foreach (ConditionalTier <T> conditionalTier in tiers) { if (ConditionsMeetForTier(conditionalTier)) { Tier = conditionalTier; AnalyticsTierName = (string.IsNullOrEmpty(conditionalTier.AnalyticsName) ? conditionalTier.name : conditionalTier.AnalyticsName); break; } } string key = $"cp.ConditionalPropertyLogged.{base.Key}"; if (PlayerPrefs.GetInt(key, 0) == 0 && definition.SendAnalytics) { PlayerPrefs.SetInt(key, 1); if (Service.IsSet <ICPSwrveService>()) { string text = base.Key.ToLower(); string tier = AnalyticsTierName.ToLower(); Service.Get <ICPSwrveService>().Action("game." + text, tier); } } }
public ConditionalConfiguration(ConditionalDefinition[] definitionDataList) { int num = definitionDataList.Length; for (int i = 0; i < num; i++) { ConditionalDefinition conditionalDefinition = definitionDataList[i]; properties[conditionalDefinition.name] = conditionalDefinition.GenerateProperty(); } }
public ConditionalProperty(ConditionalDefinition <T> definition) { base.Key = definition.name; defaultValue = definition.DefaultValue; CalculateTier(definition); }