protected override void InitCmd(CmdList cmdList)
    {
        cmdList.Clear();
        if (plant == null)
        {
            return;
        }

        base.InitCmd(cmdList);

        if (!plant.mDead)
        {
            if (!plant.IsRipe)
            {
                cmdList.Remove("Get");

                if (plant.NeedWater)
                {
                    cmdList.Add("Water", OnWaterBtn);
                }

                if (plant.NeedClean)
                {
                    cmdList.Add("Clean", OnCleanBtn);
                }
            }
        }
        else
        {
            cmdList.Remove("Get");
        }
        cmdList.Add("Remove", OnClearBtn);
    }
Exemple #2
0
 protected override void InitCmd(CmdList cmdList)
 {
     cmdList.Add("Turn", Turn90Degree);
     cmdList.Add("Get", OnGetBtn);
     if (Operatable())
     {
         AddOperateCmd(cmdList);
     }
 }
    protected override void InitCmd(CmdList cmdList)
    {
        cmdList.Add("Get On", GetOnCarrier);
        //if (GameConfig.IsMultiMode)
        // {
        //cmdList.Add("Repair", OnRepair);
        //cmdList.Add("Charge", OnCharge);
        // }

        cmdList.Add("Get", OnGetBtn);
    }
    protected override void InitCmd(CmdList cmdList)
    {
        base.InitCmd(cmdList);

        if (door.IsOpen)
        {
            cmdList.Add("Shut", ShutDoor);
        }
        else
        {
            cmdList.Add("Open", OpenDoor);
        }
    }
        public void PushGang(string uid, int card1, int card2, int card3)
        {
            CmdList.Add(new CmdEntity()
            {
                Uid   = uid,
                AType = ActionType.Gang,
                Card  = card1,
                Card1 = card2,
                Card2 = card3
            });

            CmdList.Add(new CmdEntity()
            {
                Uid   = uid,
                AType = ActionType.GangDa,
                Card  = card2
            });

            CmdList.Add(new CmdEntity()
            {
                Uid   = uid,
                AType = ActionType.GangDa,
                Card  = card3
            });
        }
Exemple #6
0
        public CmdCase(Sugarism.CmdCase model) : base(model)
        {
            _model = model;

            _cmdList = new ObservableCollection <Command>();
            foreach (Sugarism.Command cmdModel in _model.CmdList)
            {
                Command cmdViewModel = Command.Create(cmdModel);
                if (null != cmdViewModel)
                {
                    CmdList.Add(cmdViewModel);
                    cmdViewModel.Owner = this;
                }
                else
                {
                    Log.Error(Properties.Resources.ErrInvalidCmdType);
                }
            }

            _parent = null;

            InputBindings.Clear();
            InputBindings.Add(new KeyBinding(CmdExpand, System.Windows.Input.Key.Enter, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(CmdAddChild, System.Windows.Input.Key.A, ModifierKeys.Control));

            if (_model.CmdList.Count <= 0)
            {
                addSampleCmd();
            }
        }
Exemple #7
0
 protected override void InitCmd(CmdList cmdList)
 {
     base.InitCmd(cmdList);
     if (null != itemObj && null != itemObj.protoData && itemObj.protoData.unchargeable)
     {
         cmdList.Add("Refill", OnRefill);
     }
 }
 public void PushDa(string uid, int card)
 {
     CmdList.Add(new CmdEntity()
     {
         Uid   = uid,
         AType = ActionType.Da,
         Card  = card
     });
 }
 public void PushMo(string uid, int card)
 {
     CmdList.Add(new CmdEntity()
     {
         AType = ActionType.Mo,
         Card  = card,
         Uid   = uid,
     });
 }
 public void PushZhuoPao(string uid, int card, int huType)
 {
     CmdList.Add(new CmdEntity()
     {
         Uid   = uid,
         AType = ActionType.ZhuoPao,
         Card  = card
     });
 }
 public void PushHu(string uid, int huType)
 {
     CmdList.Add(new CmdEntity()
     {
         Uid    = uid,
         AType  = ActionType.Hu,
         HuType = huType
     });
 }
Exemple #12
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public RequestCmd AddQuery(string pScript, IDictionary <string, IWeaverQueryVal> pParams)
        {
            string[] args = WeaverUtil.GetScriptAndParamJson(pScript, pParams);

            RequestCmd rc = new RequestCmd(RexConn.Command.Query.ToString().ToLower(), args);

            CmdList.Add(rc);
            return(rc);
        }
 public void PushBuZhang(string uid, int card, int mCard)
 {
     CmdList.Add(new CmdEntity()
     {
         Uid   = uid,
         AType = ActionType.BuZhang,
         Card  = card,
         Card1 = mCard
     });
 }
    protected override void InitCmd(CmdList cmdList)
    {
        base.InitCmd(cmdList);
        if (CanRefill())
        {
            cmdList.Add("Refill", RefillByUI);
        }

        gOperationTower = this;
    }
    protected override void InitCmd(CmdList cmdList)
    {
        cmdList.Add("Turn", Turn90Degree);
        cmdList.Add("Get", OnGetBtn);

        //if (!GameConfig.IsMultiMode)
        {
            if (bedView.peSleep.CanOperateMask(Pathea.Operate.EOperationMask.Sleep))
            {
                cmdList.Add("Sleep", () =>
                {
                    if (EntityMonsterBeacon.IsRunning())
                    {
                        PeTipMsg.Register(PELocalization.GetString(8000596), PeTipMsg.EMsgLevel.Warning);
                        return;
                    }
                    if (!bedView.peSleep.CanOperateMask(Pathea.Operate.EOperationMask.Sleep))
                    {
                        return;
                    }

                    Pathea.OperateCmpt operateCmpt = Pathea.MainPlayer.Instance.entity.operateCmpt;
                    if (null != operateCmpt && operateCmpt.HasOperate)
                    {
                        return;
                    }

                    Pathea.MotionMgrCmpt mmc = Pathea.MainPlayer.Instance.entity.GetCmpt <Pathea.MotionMgrCmpt>();

                    if (null != mmc && (mmc.IsActionRunning(Pathea.PEActionType.Sleep) || !mmc.CanDoAction(Pathea.PEActionType.Sleep)))
                    {
                        return;
                    }

                    //if (GameConfig.IsMultiMode)
                    //     GameUI.Instance.mItemOp.SleepImmediately(bedView.peSleep, Pathea.MainPlayer.Instance.entity);
                    //else
                    GameUI.Instance.mItemOp.ShowSleepWnd(true, this, bedView.peSleep, Pathea.MainPlayer.Instance.entity);
                });
            }
        }
    }
 public void PushChi(string uid, int card1, int card2, int card3)
 {
     CmdList.Add(new CmdEntity()
     {
         Uid   = uid,
         AType = ActionType.Chi,
         Card  = card1,
         Card1 = card2,
         Card2 = card3
     });
 }
    protected override void InitCmd(CmdList cmdList)
    {
        //base.InitCmd(cmdList);

        if (simpleObjPart.CanRotateObject())
        {
            cmdList.Add("Turn", Turn90Degree);
        }

        if (simpleObjPart.CanRecycle())
        {
            cmdList.Add("Get", OnGetBtn);
        }

        //if (!GameConfig.IsMultiMode)
        //{
        CmdList list = simpleObjPart.GetCmdList();

        for (int i = 0; i < list.count; i++)
        {
            cmdList.Add(list.Get(i));
        }
        // }
    }
Exemple #18
0
        public Scene(Sugarism.Scene model)
        {
            _model = model;

            _cmdList = new ObservableCollection <Command>();
            foreach (Sugarism.Command cmdModel in _model.CmdList)
            {
                Command cmdViewModel = Command.Create(cmdModel);
                if (null != cmdViewModel)
                {
                    CmdList.Add(cmdViewModel);
                    cmdViewModel.Owner = this;
                }
                else
                {
                    Log.Error(Properties.Resources.ErrInvalidCmdType);
                }
            }

            _owner = null;

            _isExpanded = false;
            _isSelected = false;

            _inputBindings = new InputBindingCollection();

            _inputBindings.Add(new KeyBinding(CmdExpand, Key.Enter, ModifierKeys.None));
            _inputBindings.Add(new KeyBinding(CmdEdit, Key.E, ModifierKeys.Control));
            _inputBindings.Add(new KeyBinding(CmdAddNext, Key.Q, ModifierKeys.Control));
            // not delete key
            _inputBindings.Add(new KeyBinding(CmdUp, Key.Up, ModifierKeys.Control));
            _inputBindings.Add(new KeyBinding(CmdDown, Key.Down, ModifierKeys.Control));
            _inputBindings.Add(new KeyBinding(CmdAddChild, Key.A, ModifierKeys.Control));

            if (_model.CmdList.Count <= 0)
            {
                addSampleCmd();
            }
        }
Exemple #19
0
 protected virtual void InitCmd(CmdList cmdList)
 {
     cmdList.Add("Turn", Turn90Degree);
     cmdList.Add("Get", OnGetBtn);
 }
 protected override void InitCmd(CmdList cmdList)
 {
     cmdList.Add("Get", OnGetBtn);
 }
 protected override void InitCmd(CmdList cmdList)
 {
     cmdList.Add("Open", OnOpen);
     cmdList.Add("Get", OnGetBtn);
     cmdList.Add("Turn", Turn90Degree);
 }
Exemple #22
0
 protected virtual void AddOperateCmd(CmdList cmdList)
 {
     cmdList.Add(m_ButtonName, OnDoOperate);
 }