/// <summary>
        /// Entry point for Decoding Bar Code.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void decodeBarCode_Click(object sender, EventArgs e)
        {
            panelConversion.Visible = true;
            lblInput.Visible        = true;
            lblOutput.Visible       = true;

            txtBoxInput.Visible = true;
            txtBoxInput.Text    = "";
            this.txtBoxInput.Focus();
            txtBoxInput.MaxLength = 52;

            txtBoxOutput.Visible = true;
            txtBoxOutput.Text    = "";

            txtBoxOutput.Font = new Font("Century Gothic, 21.75pt", 21.75f);

            btnFontStyle.Visible = false;
            btnClear.Visible     = true;

            btnConvert.Visible = true;
            btnConvert.Text    = "Decode";

            pictureBoxBg.Visible = false;
            lblTitle.Text        = "Decode Bar Code to Zip Code";
            lblInput.Text        = "Enter Bar Code";

            actionType = EnumActionType.DecodeBarCode;
        }
        /// <summary>
        /// Entry point for Encoding Zip Code.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void encodeZipCode_Click(object sender, EventArgs e)
        {
            panelConversion.Visible = true;
            lblInput.Visible        = true;
            lblOutput.Visible       = true;

            txtBoxInput.Visible = true;
            this.txtBoxInput.Focus();
            txtBoxInput.Text      = "";
            txtBoxInput.MaxLength = 10;

            txtBoxOutput.Visible = true;
            txtBoxOutput.Text    = "";

            btnFontStyle.Visible = true;
            btnClear.Visible     = true;

            btnConvert.Visible = true;
            btnConvert.Text    = "Encode";

            pictureBoxBg.Visible = false;
            lblTitle.Text        = "Encode Zip Code to Bar Code";
            lblInput.Text        = "Enter Zip Code";

            actionType = EnumActionType.EncodeZipCode;
        }
Example #3
0
 public bool IsActionEnable(EnumActionType t)
 {
     if (t == EnumActionType.Wait)
     {
         return(true);
     }
     return(GetActionPointCost(t) <= GetActionPoint());
 }
Example #4
0
    /// <summary>
    /// 检查是否拥有位置事件
    /// </summary>
    /// <param name="chLogic"></param>
    /// <param name="info"></param>
    /// <returns></returns>
    public bool GetBattleAction_Location(CharacterLogic chLogic, ref IActionMenu.UIActionButtonInfo info)
    {
        var locationEvent = chapterManager.Event.EventInfo.GetLocationEvent(chLogic.GetTileCoord(), chLogic.GetID());

        if (locationEvent == null)
        {
            Debug.Log("没有Location事件");
            return(false);
        }
        Debug.Log("找到相匹配的Location Event" + locationEvent);

        EnumActionType actionType = EnumActionType.OpenTreasureBox;

        if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.占领)
        {
            actionType = EnumActionType.All;
        }
        if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.访问)
        {
            actionType = EnumActionType.Visit;
        }

        info.name   = locationEvent.GetButtonText();
        info.action = () =>
        {
            gameMode.BeforePlaySequence();
            HideBattlaActionMenu(false);
            if (locationEvent.Sequence != null)
            {
                locationEvent.Execute(chapterManager.Event.EventInfo, () =>
                {
                    gameMode.AfterPlaySequence();
                    if (locationEvent.Caption != EventInfoCollection.EnumLocationEventCaption.占领)//如果是占领,则不再弹出选项菜单了
                    {
                        ShowBattleActionMenu(ActionMenuState, chLogic);
                    }
                });
            }

            chLogic.ConsumeActionPoint(actionType);

            if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.占领)
            {
                //gameMode.ChapterManager.CheckWin_Seize();
            }
            if (locationEvent.Caption == EventInfoCollection.EnumLocationEventCaption.开门)
            {
                //gameMode.GridTileManager.OpenDoor(new Vector2Int(0, 0));
            }
        };
        info.enable = chLogic.IsActionEnable(actionType);
        return(true);
    }
Example #5
0
 public int ConsumeActionPoint(EnumActionType action)
 {
     if (action == EnumActionType.All)
     {
         BattleInfo.actionPoint = 0;
     }
     else
     {
         BattleInfo.actionPoint -= GetActionPointCost(action);
         if (BattleInfo.actionPoint < 0)
         {
             Debug.LogError("行动点已经小于0了");
         }
     }
     return(BattleInfo.actionPoint);
 }
Example #6
0
    public int GetActionPointCost(EnumActionType t)
    {
        switch (t)
        {
        case EnumActionType.Move:
            return(careerDef.ActionCost.Move);

        case EnumActionType.Attack:
            return(careerDef.ActionCost.Attack);

        case EnumActionType.Skill:
            return(careerDef.ActionCost.Skill);

        case EnumActionType.Item:
            return(careerDef.ActionCost.Item);

        case EnumActionType.ExchangeItem:
            return(careerDef.ActionCost.ExchangeItem);

        case EnumActionType.Heal:
            return(careerDef.ActionCost.Heal);

        case EnumActionType.Steal:
            return(careerDef.ActionCost.Steal);

        case EnumActionType.Visit:
            return(careerDef.ActionCost.Visit);

        case EnumActionType.OpenTreasureBox:
            return(careerDef.ActionCost.OpenTreasureBox);

        case EnumActionType.Talk:
            return(careerDef.ActionCost.Talk);

        case EnumActionType.Wait:
            break;
        }
        return(0);
    }
Example #7
0
 public ActionType(EnumActionType action)
 {
     this.actionType = action;
 }
Example #8
0
 public ZPT(RFIDData data, EnumActionType type = EnumActionType.激光雕刻)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.物料信息;
 }
Example #9
0
 public JQR05(RFIDData data, EnumActionType type)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.物料信息;
 }
Example #10
0
 public JQR03(RFIDData data, EnumActionType type = EnumActionType.抓取下料位物料至定位台4)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.料盘信息 | EnumActionParameter.物料信息;
 }
Example #11
0
 public JQR01(RFIDData data, EnumActionType type = EnumActionType.抓取定位台物料至流水线上料位)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.料盘信息 | EnumActionParameter.物料信息;
 }
Example #12
0
 public SJJ02(RFIDData data, EnumActionType type)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.料盘信息 | EnumActionParameter.物料信息;
 }
Example #13
0
 public DWT04(RFIDData data, EnumActionType type = EnumActionType.定位台4转移物料至AGV)
     : base(data)
 {
     ActionType      = (int)type;
     ActionParameter = EnumActionParameter.料盘信息 | EnumActionParameter.物料信息;
 }