Пример #1
0
 protected bool Equals(Order other)
 {
     return(base.Equals(other) &&
            Type == other.Type &&
            SellerAgentAddress.Equals(other.SellerAgentAddress) &&
            SellerAvatarAddress.Equals(other.SellerAvatarAddress) &&
            Price.Equals(other.Price) &&
            ItemSubType == other.ItemSubType);
 }
Пример #2
0
 protected bool Equals(PurchaseInfo other)
 {
     return(OrderId.Equals(other.OrderId) &&
            TradableId.Equals(other.TradableId) &&
            SellerAgentAddress.Equals(other.SellerAgentAddress) &&
            SellerAvatarAddress.Equals(other.SellerAvatarAddress) &&
            ItemSubType == other.ItemSubType &&
            Price.Equals(other.Price));
 }
Пример #3
0
        public override IValue Serialize()
        {
            var innerDictionary = ((Dictionary)base.Serialize())
                                  .SetItem(SellerAgentAddressKey, SellerAgentAddress.Serialize())
                                  .SetItem(SellerAvatarAddressKey, SellerAvatarAddress.Serialize())
                                  .SetItem(PriceKey, Price.Serialize())
                                  .SetItem(OrderTypeKey, Type.Serialize())
                                  .SetItem(ItemSubTypeKey, ItemSubType.Serialize());

            return(new Dictionary(innerDictionary));
        }
Пример #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = OrderId.GetHashCode();
         hashCode = (hashCode * 397) ^ TradableId.GetHashCode();
         hashCode = (hashCode * 397) ^ SellerAgentAddress.GetHashCode();
         hashCode = (hashCode * 397) ^ SellerAvatarAddress.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)ItemSubType;
         hashCode = (hashCode * 397) ^ Price.GetHashCode();
         return(hashCode);
     }
 }
Пример #5
0
        public IValue Serialize()
        {
            var dictionary = new Dictionary <IKey, IValue>
            {
                [(Text)OrderIdKey]             = OrderId.Serialize(),
                [(Text)SellerAvatarAddressKey] = SellerAvatarAddress.Serialize(),
                [(Text)SellerAgentAddressKey]  = SellerAgentAddress.Serialize(),
                [(Text)ItemSubTypeKey]         = ItemSubType.Serialize(),
                [(Text)PriceKey]      = Price.Serialize(),
                [(Text)TradableIdKey] = TradableId.Serialize(),
            };

            return(new Bencodex.Types.Dictionary(dictionary));
        }