Ejemplo n.º 1
0
        private void DrawPaymentCurrency(PaymentCurrency _paymentCurrency)
        {
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.BeginHorizontal();
            {
                _paymentCurrency.currency = (Currency)EditorGUILayout.ObjectField(GUIContent.none, _paymentCurrency.currency, typeof(Currency), false, GUILayout.Width(200));
                EditorGUILayout.LabelField(new GUIContent("Cost"), GUILayout.Width(80));
                _paymentCurrency.cost = EditorGUILayout.DoubleField(GUIContent.none, _paymentCurrency.cost);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                _paymentCurrency.lockedOnNotPurchasable = EditorGUILayout.Toggle(GUIContent.none, _paymentCurrency.lockedOnNotPurchasable, GUILayout.Width(12));
                EditorGUILayout.LabelField(new GUIContent("Locked On Not Purchasable"), GUILayout.Width(184));
                EditorGUILayout.LabelField(new GUIContent("Cost Multiplier"), GUILayout.Width(80));
                _paymentCurrency.costMultiplier = EditorGUILayout.FloatField(GUIContent.none, _paymentCurrency.costMultiplier);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            {
                _paymentCurrency.NumberOfPurchaseDone = EditorGUILayout.IntField(new GUIContent("Number of Purchase Done :"), _paymentCurrency.NumberOfPurchaseDone);
            }
            EditorGUILayout.EndHorizontal();

            if (EditorGUI.EndChangeCheck())
            {
                EditorUtility.SetDirty(_paymentCurrency);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (MinPaymentAmount != null)
         {
             hashCode = hashCode * 59 + MinPaymentAmount.GetHashCode();
         }
         if (PaymentDueAmount != null)
         {
             hashCode = hashCode * 59 + PaymentDueAmount.GetHashCode();
         }
         if (PaymentCurrency != null)
         {
             hashCode = hashCode * 59 + PaymentCurrency.GetHashCode();
         }
         if (PaymentDueDate != null)
         {
             hashCode = hashCode * 59 + PaymentDueDate.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if BankingCreditCardAccount instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingCreditCardAccount to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingCreditCardAccount other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     MinPaymentAmount == other.MinPaymentAmount ||
                     MinPaymentAmount != null &&
                     MinPaymentAmount.Equals(other.MinPaymentAmount)
                     ) &&
                 (
                     PaymentDueAmount == other.PaymentDueAmount ||
                     PaymentDueAmount != null &&
                     PaymentDueAmount.Equals(other.PaymentDueAmount)
                 ) &&
                 (
                     PaymentCurrency == other.PaymentCurrency ||
                     PaymentCurrency != null &&
                     PaymentCurrency.Equals(other.PaymentCurrency)
                 ) &&
                 (
                     PaymentDueDate == other.PaymentDueDate ||
                     PaymentDueDate != null &&
                     PaymentDueDate.Equals(other.PaymentDueDate)
                 ));
        }
Ejemplo n.º 4
0
        public async Task <PurchaseTokensData> PurchaseXLMs(double euroCents, PaymentCurrency paymentCurrency)
        {
            var request = PrepareRequest(apiVersion + "/purchase_xlm", Method.POST);

            request.AddParameter("euro_cents", euroCents * 100);
            request.AddParameter("payment_currency", paymentCurrency.ToString());

            return(await SendRequest <PurchaseTokensData>(request));
        }
Ejemplo n.º 5
0
        protected virtual void DisplayPayment(PaymentCurrency _payment)
        {
            if (_payment != null)
            {
                if (paymentValue)
                {
                    if (_payment.cost == 0)
                    {
                        if (paymentValue)
                        {
                            paymentValue.text = "FREE";
                        }
                    }
                    else
                    {
                        paymentValue.text = _payment.Price.ToShortString();
                    }
                }

                if (_payment.currency == null)
                {
                    return;
                }

                if (paymentIcon != null)
                {
                    paymentIcon.sprite = _payment.currency.icon;
                    paymentIcon.color  = _payment.currency.color;
                }

                if (_payment.lockedOnNotPurchasable)
                {
                    buttonPicker.interactable = _payment.IsAvailable;
                }
            }
        }
Ejemplo n.º 6
0
 public virtual void Display(PaymentCurrency _payment)
 {
     name = _payment.GetType().ToString();
     DisplayPayment(_payment);
 }
Ejemplo n.º 7
0
 EqualityComparer <Currency> .Default.Equals(PaymentCurrency, forward.PaymentCurrency) &&
Ejemplo n.º 8
0
 EqualityComparer <Currency> .Default.Equals(PaymentCurrency, euroOpt.PaymentCurrency) &&