Пример #1
0
 public override IValue Serialize() =>
 new Bencodex.Types.Dictionary(new Dictionary <IKey, IValue>
 {
     [(Text)"shopItem"] = shopItem.Serialize(),
     [(Text)"id"]       = id.Serialize(),
     [(Text)"gold"]     = gold.Serialize(),
 }.Union((Bencodex.Types.Dictionary)base.Serialize()));
Пример #2
0
 public IValue Serialize() =>
 new Dictionary(new Dictionary <IKey, IValue>
 {
     [(Text)"sellerAgentAddress"]  = SellerAgentAddress.Serialize(),
     [(Text)"sellerAvatarAddress"] = SellerAvatarAddress.Serialize(),
     [(Text)"productId"]           = ProductId.Serialize(),
     [(Text)"itemUsable"]          = ItemUsable.Serialize(),
     [(Text)"price"] = Price.Serialize(),
 });
Пример #3
0
        public override IValue Serialize()
        {
            var innerDict = ((Dictionary)base.Serialize())
                            .SetItem(SellerAgentAddressKey, SellerAgentAddress.Serialize())
                            .SetItem(PriceKey, Price.Serialize())
                            .SetItem(CombatPointKey, CombatPoint.Serialize())
                            .SetItem(LevelKey, Level.Serialize())
                            .SetItem(ItemIdKey, ItemId.Serialize())
                            .SetItem(ItemCountKey, ItemCount.Serialize());

            return(new Dictionary(innerDict));
        }
Пример #4
0
        public IValue Serialize()
        {
            var innerDictionary = new Dictionary <IKey, IValue>
            {
                [(Text)"sellerAgentAddress"]  = SellerAgentAddress.Serialize(),
                [(Text)"sellerAvatarAddress"] = SellerAvatarAddress.Serialize(),
                [(Text)"productId"]           = ProductId.Serialize(),
                [(Text)"price"] = Price.Serialize(),
            };

            if (ItemUsable != null)
            {
                innerDictionary.Add((Text)"itemUsable", ItemUsable.Serialize());
            }

            if (Costume != null)
            {
                innerDictionary.Add((Text)"costume", Costume.Serialize());
            }

            return(new Dictionary(innerDictionary));
        }