コード例 #1
0
        public void OnMintBuyShopSlot(object response)
        {
            logger.Debug($"OnMintBuyShopSlot UserID={UID}");

            var shopSlot = processShopSlot;

            if (shopSlot == null)
            {
                logger.Error($"OnMintBuyShopSlot shopSlot is null UserID={UID}");
                return;
            }
            shopSlot.OnBuy(response, this);
            stateType       = UserStateType.None;
            processShopSlot = null;
        }
コード例 #2
0
        public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot)
        {
            if (!CheckConsume(priceType, priceValue))
            {
                return(ConsumeState.ConsumeState_Falied);
            }

            if (priceValue == 0)
            {
                return(ConsumeState.ConsumeState_Done);
            }

            SetPrice("", -priceValue);

            return(ConsumeState.ConsumeState_Done);
        }
コード例 #3
0
 public abstract ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot);
コード例 #4
0
        public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot)
        {
            if (!CheckConsume(priceType, priceValue))
            {
                return(ConsumeState.ConsumeState_Falied);
            }

            if (priceValue == 0)
            {
                return(ConsumeState.ConsumeState_Done);
            }

            user.stateType       = userStateType;
            user.processShopSlot = shopSlot;

            if (fungibleType == Resource.FungibleType.Fungible)
            {
                user.WithdrawFungible(TokenType(), (int)priceValue);
            }
            else if (fungibleType == Resource.FungibleType.ServiceToken)
            {
                user.WithdrawServiceToken((int)priceValue);
            }

            return(ConsumeState.ConsumeState_Request_Burn);
        }