Esempio n. 1
0
 /// <summary>
 /// 消耗显示处理
 /// </summary>
 /// <param name="roomData"></param>
 private void CostShow(RoomInfoData roomData)
 {
     if (CostContainer)
     {
         bool         showState = false;
         EnumCostType costtype  = (EnumCostType)Enum.Parse(typeof(EnumCostType), roomData.GoldType);
         if (costtype != null)
         {
             if (costtype != EnumCostType.TempCoin)
             {
                 showState = true;
                 CostContainer.SetActive(true);
                 if (GoldMin)
                 {
                     GoldMin.text = string.Format(MinLabelForMat, roomData.GoldMin);
                 }
                 if (GoldMax)
                 {
                     GoldMax.text = roomData.GoldMax.ToString();
                 }
                 if (Goldtype)
                 {
                     Goldtype.spriteName = roomData.GoldType;
                 }
             }
         }
         CostContainer.SetActive(showState);
     }
 }
Esempio n. 2
0
    public EnumCostType GetEnumCostType()
    {
        EnumCostType costType = EnumCostType.其他;
        string       sValue   = hdCostType.Value;

        if (!string.IsNullOrEmpty(sValue))
        {
            costType = (EnumCostType)Enum.Parse(typeof(EnumCostType), sValue);
        }
        return(costType);
    }
Esempio n. 3
0
        private void OnOpenQuickGame()
        {
            var          userInfo  = UserInfoModel.Instance.UserInfo;
            EnumCostType costType  = _curData.CostType;
            var          maxCost   = _curData.MaxValue;
            var          minCost   = _curData.MinVlaue;
            double       haveValue = 0;
            string       costName  = "";

            if (maxCost > 0)
            {
                switch (costType)
                {
                case EnumCostType.Cash:
                    haveValue = userInfo.CashA;
                    costName  = CashName;
                    break;

                case EnumCostType.Gold:
                    haveValue = YxUtiles.GetShowNumber(userInfo.CoinA + userInfo.BankCoin);
                    costName  = GoldName;
                    break;

                case EnumCostType.TempCoin:
                    haveValue = int.MaxValue;
                    break;

                case EnumCostType.GroupCoin:
                    costName  = GroupCoinName;
                    haveValue = int.MaxValue;
                    break;

                default:
                    haveValue = int.MaxValue;
                    break;
                }
                if (minCost > haveValue)
                {
                    YxMessageBox.Show(string.Format(LowerLimitNotice, minCost, costName, haveValue));
                    return;
                }
                if (maxCost < haveValue)
                {
                    YxMessageBox.Show(string.Format(UpperLimitNotice, minCost, costName, haveValue));
                    return;
                }
            }
            RoomUnitModel model = new RoomUnitModel(null);

            model.TypeId  = _curData.GameType.ToString();
            model.GameKey = _curData.GameKey;
            RoomListController.Instance.OnDirectGame(model);
        }
Esempio n. 4
0
        protected override void ParseData(Dictionary <string, object> dic)
        {
            base.ParseData(dic);
            dic.TryGetValueWitheKey(out _id, KeyId);
            dic.TryGetValueWitheKey(out _title, KeyTitle);
            dic.TryGetValueWitheKey(out _startTime, KeyStartTime);
            dic.TryGetValueWitheKey(out _endTime, KeyEndTime);
            dic.TryGetValueWitheKey(out _gameKey, KeyGameKey);
            dic.TryGetValueWitheKey(out _gameType, KeyGameType);
            dic.TryGetValueWitheKey(out _maxValue, KeyGameMaxValue);
            dic.TryGetValueWitheKey(out _minVlaue, KeyGameMinValue);
            var status = 0;

            dic.TryGetValueWitheKey(out status, KeyStatus);
            _state = (EnumMatchState)status;
            var costType = "";

            dic.TryGetValueWitheKey(out costType, KeyGameCostType);
            _costType = YxTools.GetCostTypeByString(costType);
        }
Esempio n. 5
0
 static JDFAutoMISDetails()
 {
     atrInfoTable[0] = new AtrInfoTable(AttributeName.COSTTYPE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumCostType.getEnum(0), null);
     atrInfoTable[1] = new AtrInfoTable(AttributeName.DEVICEOPERATIONMODE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumDeviceOperationMode.getEnum(0), null);
     atrInfoTable[2] = new AtrInfoTable(AttributeName.WORKTYPE, 0x33333311, AttributeInfo.EnumAttributeType.enumeration, EnumWorkType.getEnum(0), null);
     atrInfoTable[3] = new AtrInfoTable(AttributeName.WORKTYPEDETAILS, 0x33333311, AttributeInfo.EnumAttributeType.string_, null, null);
 }
Esempio n. 6
0
 ///
 ///          <summary> * (9) get attribute CostType </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumCostType getCostType()
 {
     return(EnumCostType.getEnum(getAttribute(AttributeName.COSTTYPE, null, null)));
 }
Esempio n. 7
0
        // ************************************************************************
        // * Attribute getter / setter
        // * ************************************************************************
        //

        //         ---------------------------------------------------------------------
        //        Methods for Attribute CostType
        //        ---------------------------------------------------------------------
        ///
        ///          <summary> * (5) set attribute CostType </summary>
        ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
        ///
        public virtual void setCostType(EnumCostType enumVar)
        {
            setAttribute(AttributeName.COSTTYPE, enumVar == null ? null : enumVar.getName(), null);
        }