コード例 #1
0
    public RemovableObjectLogicObject(RemovableObjectData data)
    {
        this.m_Data      = data;
        this.m_LogicData = new RemovableObjectLogicData(data);

        if (data.RemainingWorkload.HasValue)
        {
            this.AddRemoveComponent();
        }
    }
コード例 #2
0
    public RemovableObjectLogicData BuyRemovableObject(RemovableObjectType type, TilePosition position)
    {
        ProductRemovableObjectConfigData configData = ConfigInterface.Instance.ProductConfigHelper.GetProductRemovableObject(type);

        this.m_PlayerModule.Consume(0, 0, 0, configData.GemPrice);

        bool isReward = false;
        int  propsNo  = this.m_PropsModule.GetNextPropsNo();
        RemovableObjectLogicData result = this.m_RemovableModule.BuyRemovableObject(type, position, propsNo, ref isReward).LogicData;

        if (!isReward)
        {
            this.m_PropsModule.ReversePropsNo();
        }
        return(result);
    }
コード例 #3
0
    public RewardConfigData FinishRemove(int removableObjectNo)
    {
        RemovableObjectLogicData logicData = this.m_RemovableModule.GetRemovableObjectData(removableObjectNo);

        this.m_RemovableModule.FinishRemove(removableObjectNo);
        this.RewardResource(0, 0, 0, logicData.RewardGem, logicData.RewardExp);

        this.m_TaskModule.OnRemoveObject(logicData.ObjectType);
        this.m_PlayerModule.RemoveObject();
        if (logicData.RewardProps.HasValue)
        {
            this.m_PropsModule.GenerateProps(logicData.RewardProps.Value, logicData.RewardPropsType.Value);
        }
        return(new RewardConfigData()
        {
            RewardGem = logicData.RewardGem, RewardExp = logicData.RewardExp
        });
    }
コード例 #4
0
    //Button message
    protected override void OnConstructBuilding()
    {
        if (base.BuildingBehavior.EnableCreate)
        {
            if (this.RemovableObjectBehavior.ProductRemovableObjectConfigData.GemPrice > LogicController.Instance.PlayerData.CurrentStoreGem)
            {
                int    costBalanceGem  = this.RemovableObjectBehavior.ProductRemovableObjectConfigData.GemPrice - LogicController.Instance.PlayerData.CurrentStoreGem;
                string title           = StringConstants.PROMT_REQUEST_RESOURCE + StringConstants.COIN_GEM;
                string resourceContext = string.Format(StringConstants.PROMPT_RESOURCE_COST, costBalanceGem, StringConstants.COIN_GEM);

                UIManager.Instance.UIWindowCostPrompt.ShowWindow(costBalanceGem, resourceContext, title);
                UIManager.Instance.UIWindowCostPrompt.UnRegistDelegate();
                UIManager.Instance.UIWindowCostPrompt.Click += () =>
                {
                    UIManager.Instance.UIWindowFocus = null;
                    UIManager.Instance.UISelectShopMenu.GoShopping();
                };
                return;
            }
            if (LogicController.Instance.AllRemovableObjects.Count(a => a.IsCountable) < ConfigInterface.Instance.SystemConfig.MaxRemovableObjectNumber)
            {
                this.RemovableObjectLogicData = LogicController.Instance.BuyRemovableObject(this.RemovableObjectBehavior.RemovableObjectType, this.RemovableObjectBehavior.FirstZoneIndex);
                this.RemovableObjectBehavior.RemovableObjectLogicData = this.RemovableObjectLogicData;
                base.BuildingBehavior.Created = true;
                this.RemovableObjectBehavior.BuildObstacle();
                SceneManager.Instance.BuildingBehaviorTemporary = null;
                base.BuildingBehavior.IsClick = false;
                base.BuildingBehavior.SetArrowState(false);
                this.RemovableObjectBehavior.DestroyButton();

                SceneManager.Instance.CreateSmokeFX(this.RemovableObjectBehavior);
            }
            else
            {
                UIErrorMessage.Instance.ErrorMessage(35);
            }
        }
    }