Пример #1
0
        public void Execute(ItemType itemType, string guid, bool contain)
        {
            var avatarState = _initialState.GetAvatarState(_avatarAddress);
            INonFungibleItem nonFungibleItem;
            Guid             itemId    = new Guid(guid);
            Guid             productId = itemId;
            ItemSubType      itemSubType;
            const long       requiredBlockIndex = 0;
            ShopState        legacyShopState    = _initialState.GetShopState();

            if (itemType == ItemType.Equipment)
            {
                var itemUsable = ItemFactory.CreateItemUsable(
                    _tableSheets.EquipmentItemSheet.First,
                    itemId,
                    requiredBlockIndex);
                nonFungibleItem = itemUsable;
                itemSubType     = itemUsable.ItemSubType;
            }
            else
            {
                var costume = ItemFactory.CreateCostume(_tableSheets.CostumeItemSheet.First, itemId);
                costume.Update(requiredBlockIndex);
                nonFungibleItem = costume;
                itemSubType     = costume.ItemSubType;
            }

            var result = new DailyReward2.DailyRewardResult()
            {
                id        = default,
Пример #2
0
        public void Execute(params ShopItemData[] shopItemMembers)
        {
            AvatarState          buyerAvatarState = _initialState.GetAvatarState(_buyerAvatarAddress);
            List <PurchaseInfo0> purchaseInfos    = new List <PurchaseInfo0>();
            Dictionary <Address, ShardedShopState> shardedShopStates = new Dictionary <Address, ShardedShopState>();
            ShopState legacyShopState = _initialState.GetShopState();

            foreach (var shopItemData in shopItemMembers)
            {
                (AvatarState sellerAvatarState, AgentState sellerAgentState) = CreateAvatarState(
                    shopItemData.SellerAgentAddress,
                    shopItemData.SellerAvatarAddress
                    );
                ITradableItem tradableItem;
                Guid          productId          = shopItemData.ProductId;
                Guid          itemId             = shopItemData.ItemId;
                long          requiredBlockIndex = shopItemData.RequiredBlockIndex;
                ItemSubType   itemSubType;
                if (shopItemData.ItemType == ItemType.Equipment)
                {
                    var itemUsable = ItemFactory.CreateItemUsable(
                        _tableSheets.EquipmentItemSheet.First,
                        itemId,
                        requiredBlockIndex);
                    tradableItem = itemUsable;
                    itemSubType  = itemUsable.ItemSubType;
                }
                else if (shopItemData.ItemType == ItemType.Costume)
                {
                    var costume = ItemFactory.CreateCostume(_tableSheets.CostumeItemSheet.First, itemId);
                    costume.Update(requiredBlockIndex);
                    tradableItem = costume;
                    itemSubType  = costume.ItemSubType;
                }
                else
                {
                    var material = ItemFactory.CreateTradableMaterial(
                        _tableSheets.MaterialItemSheet.OrderedList.First(r => r.ItemSubType == ItemSubType.Hourglass));
                    material.RequiredBlockIndex = requiredBlockIndex;
                    tradableItem = material;
                    itemSubType  = ItemSubType.Hourglass;
                }

                var result = new DailyReward2.DailyRewardResult()
                {
                    id        = default,
Пример #3
0
        public void Execute(
            ItemType itemType,
            string guid,
            int itemCount,
            int inventoryCount,
            int expectedCount,
            bool backward
            )
        {
            var           avatarState = _initialState.GetAvatarState(_avatarAddress);
            ITradableItem tradableItem;
            Guid          itemId  = new Guid(guid);
            Guid          orderId = Guid.NewGuid();
            ItemSubType   itemSubType;
            const long    requiredBlockIndex = Order.ExpirationInterval;

            if (itemType == ItemType.Equipment)
            {
                var itemUsable = ItemFactory.CreateItemUsable(
                    _tableSheets.EquipmentItemSheet.First,
                    itemId,
                    requiredBlockIndex);
                tradableItem = itemUsable;
                itemSubType  = itemUsable.ItemSubType;
            }
            else if (itemType == ItemType.Costume)
            {
                var costume = ItemFactory.CreateCostume(_tableSheets.CostumeItemSheet.First, itemId);
                costume.Update(requiredBlockIndex);
                tradableItem = costume;
                itemSubType  = costume.ItemSubType;
            }
            else
            {
                var material = ItemFactory.CreateTradableMaterial(
                    _tableSheets.MaterialItemSheet.OrderedList.First(r => r.ItemSubType == ItemSubType.Hourglass));
                itemSubType = material.ItemSubType;
                material.RequiredBlockIndex = requiredBlockIndex;
                tradableItem = material;
            }

            var result = new DailyReward2.DailyRewardResult()
            {
                id        = default,
Пример #4
0
        public void Execute(params OrderData[] orderDataList)
        {
            AvatarState         buyerAvatarState = _initialState.GetAvatarState(_buyerAvatarAddress);
            List <PurchaseInfo> purchaseInfos    = new List <PurchaseInfo>();
            ShopState           legacyShopState  = _initialState.GetShopState();

            foreach (var orderData in orderDataList)
            {
                (AvatarState sellerAvatarState, AgentState sellerAgentState) = CreateAvatarState(
                    orderData.SellerAgentAddress,
                    orderData.SellerAvatarAddress
                    );
                ITradableItem tradableItem;
                Guid          orderId = orderData.OrderId;
                Guid          itemId  = orderData.TradableId;
                ItemSubType   itemSubType;
                if (orderData.ItemType == ItemType.Equipment)
                {
                    var itemUsable = ItemFactory.CreateItemUsable(
                        _tableSheets.EquipmentItemSheet.First,
                        itemId,
                        0);
                    tradableItem = itemUsable;
                    itemSubType  = itemUsable.ItemSubType;
                }
                else if (orderData.ItemType == ItemType.Costume)
                {
                    var costume = ItemFactory.CreateCostume(_tableSheets.CostumeItemSheet.First, itemId);
                    tradableItem = costume;
                    itemSubType  = costume.ItemSubType;
                }
                else
                {
                    var material = ItemFactory.CreateTradableMaterial(
                        _tableSheets.MaterialItemSheet.OrderedList.First(r => r.ItemSubType == ItemSubType.Hourglass));
                    tradableItem = material;
                    itemSubType  = ItemSubType.Hourglass;
                }

                var result = new DailyReward2.DailyRewardResult()
                {
                    id        = default,