Beispiel #1
0
        public static AnalyticsResult ItemSpent(AcquisitionType currencyType, string transactionContext, float amount, string itemId, float balance, string itemType = null, string level = null, string transactionId = null, IDictionary <string, object> eventData = null)
        {
            CustomEvent(EventNameItemSpent, eventData
                        .Copy()
                        .SafeAdd(EventColumnMonetizationCurrencyType, AnalyticsEnums.Get(currencyType))
                        .SafeAdd(EventColumnMonetizationTransactionContext, transactionContext)
                        .SafeAdd(EventColumnMonetizationAmount, amount)
                        .SafeAdd(EventColumnMonetizationItemId, itemId)
                        .SafeAddIf(EventColumnMonetizationBalance, balance, balance != float.MinValue)
                        .SafeAdd(EventColumnMonetizationItemType, itemType)
                        .SafeAdd(EventColumnMonetizationLevel, level)
                        .SafeAdd(EventColumnMonetizationTransactionId, transactionId));

            #if UNITY_ANALYTICS_SUPPORTED
            if (balance == float.MinValue)
            {
                return(AnalyticsEnums.Convert(UnityEngine.Analytics.AnalyticsEvent.ItemSpent(AnalyticsEnums.Convert(currencyType), transactionContext, amount, itemId, itemType, level, transactionId, eventData)));
            }
            else
            {
                return(AnalyticsEnums.Convert(UnityEngine.Analytics.AnalyticsEvent.ItemSpent(AnalyticsEnums.Convert(currencyType), transactionContext, amount, itemId, balance, itemType, level, transactionId, eventData)));
            }
            #else
            return(GetNoUnityAnalyitcsDefineResult());
            #endif
        }
 public static AnalyticsResult ItemSpent(AcquisitionType currencyType, string transactionContext, float amount, string itemId, string itemType = null, string level = null, string transactionId = null, IDictionary <string, object> eventData = null)
 {
     AnalyticsEvent.m_EventData.Clear();
     AnalyticsEvent.m_EventData.Add("currency_type", AnalyticsEvent.RenameEnum(currencyType.ToString()));
     if (string.IsNullOrEmpty(transactionContext))
     {
         throw new ArgumentException(transactionContext);
     }
     AnalyticsEvent.m_EventData.Add("transaction_context", transactionContext);
     AnalyticsEvent.m_EventData.Add("amount", amount);
     if (string.IsNullOrEmpty(itemId))
     {
         throw new ArgumentException(itemId);
     }
     AnalyticsEvent.m_EventData.Add("item_id", itemId);
     if (!string.IsNullOrEmpty(itemType))
     {
         AnalyticsEvent.m_EventData.Add("item_type", itemType);
     }
     if (!string.IsNullOrEmpty(level))
     {
         AnalyticsEvent.m_EventData.Add("level", level);
     }
     if (!string.IsNullOrEmpty(transactionId))
     {
         AnalyticsEvent.m_EventData.Add("transaction_id", transactionId);
     }
     AnalyticsEvent.AddCustomEventData(eventData);
     return(AnalyticsEvent.Custom("item_spent", AnalyticsEvent.m_EventData));
 }
        public static string Get(AcquisitionType acquisitionType)
        {
            if (AcquisitionTypeCache.TryGetValue(acquisitionType, out string enumString) == false)
            {
                enumString = acquisitionType.ToString();
                AcquisitionTypeCache.Add(acquisitionType, enumString);
            }

            return(enumString);
        }
 public PhaseModeTCP(string t_pOnCommand, string t_pOffCommand, AcquisitionType t_acquisitionType, string t_acquisitionTriggerCommand, int t_pOnTime, int t_pOffTime, string t_IPAdrr, int t_port)
 {
     pOnCommand                = t_pOnCommand;
     pOffCommand               = t_pOffCommand;
     acquisitionType           = t_acquisitionType;
     acquisitionTriggerCommand = t_acquisitionTriggerCommand;
     pOnTime  = t_pOnTime;
     pOffTime = t_pOffTime;
     IPAdrr   = t_IPAdrr;
     port     = t_port;
 }
        public static AnalyticsResult ItemSpent(
            AcquisitionType currencyType,
            string transactionContext,
            float amount,
            string itemId,
            string itemType      = null,
            string level         = null,
            string transactionId = null,
            IDictionary <string, object> eventData = null)
        {
            AnalyticsResult analyticsResult = new AnalyticsResult();

            return(analyticsResult);
        }
        public void ItemSpent_CurrencyTypeTest(
            [Values(AcquisitionType.Premium, AcquisitionType.Soft)] AcquisitionType currencyType)
        {
            var context = "test";
            var amount  = 1f;
            var itemId  = "test_item";
            var balance = 1f;

            Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
            EvaluateAnalyticsResult(m_Result);

            Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
            EvaluateAnalyticsResult(m_Result);
        }
Beispiel #7
0
 public Step(
     ResourceQuantity[] buildCondition,
     StepType[] types,
     RewardQuantity[] reward,
     int warPoints,
     AcquisitionType commercialType,
     ResourceMetaType resourceMetaType,
     BuilderType builder
     )
 {
     this.BuildCondition   = buildCondition;
     this.Types            = types;
     this.Reward           = reward;
     this.WarPoints        = warPoints;
     this.CommercialType   = commercialType;
     this.ResourceMetaType = resourceMetaType;
     this.Builder          = builder;
 }
Beispiel #8
0
 public static AnalyticsResult ItemSpent(AcquisitionType currencyType, string transactionContext, float amount, string itemId, float balance, string itemType = null, string level = null, string transactionId = null, IDictionary <string, object> eventData = null)
 {
     m_EventData.Clear();
     if (string.IsNullOrEmpty(transactionContext))
     {
         OnValidationFailed(string.Format(k_ErrorFormat_RequiredParamNotSet, "transaction_context"));
     }
     else
     {
         m_EventData.Add("transaction_context", transactionContext);
     }
     if (string.IsNullOrEmpty(itemId))
     {
         OnValidationFailed(string.Format(k_ErrorFormat_RequiredParamNotSet, "item_id"));
     }
     else
     {
         m_EventData.Add("item_id", itemId);
     }
     if (!string.IsNullOrEmpty(itemType))
     {
         m_EventData.Add("item_type", itemType);
     }
     if (!string.IsNullOrEmpty(level))
     {
         m_EventData.Add("level", level);
     }
     if (!string.IsNullOrEmpty(transactionId))
     {
         m_EventData.Add("transaction_id", transactionId);
     }
     m_EventData.Add("currency_type", EnumToString(currencyType));
     m_EventData.Add("amount", amount);
     m_EventData.Add("balance", balance);
     AddCustomEventData(eventData);
     return(Custom("item_spent", m_EventData));
 }
Beispiel #9
0
 public static UnityEngine.Analytics.AcquisitionType Convert(AcquisitionType acquisitionType)
 {
     return((UnityEngine.Analytics.AcquisitionType)((int)acquisitionType));
 }
Beispiel #10
0
 public static AnalyticsResult ItemSpent(AcquisitionType currencyType, string transactionContext, float amount, string itemId, string itemType = null, string level = null, string transactionId = null, IDictionary <string, object> eventData = null)
 {
     return(ItemSpent(currencyType, transactionContext, amount, itemId, float.MinValue, itemType, level, transactionId, eventData));
 }