Пример #1
0
    public string CCOUNT(RegexInfo reg, string strText)
    {
        if (EntityFactory.MainHeroView == null || !_propertyRatio.ContainsKey("CCOUNT"))
        {
            return(null);
        }

        if (_propertyRatio["CCOUNT"].Count == 0)
        {
            return(null);
        }

        int ratio = _propertyRatio["CCOUNT"][0].nRatio;

        _propertyRatio["CCOUNT"].RemoveAt(0);

        if (!_dicChargeCount.ContainsKey(ratio))
        {
            return("0");
        }
        chargeValue_Info valueInfo = _dicChargeCount[ratio];
        int    ShowNum             = valueInfo.chargeCount;
        string appendNum           = string.Format("{0:D1}", ShowNum);

        return(appendNum);
    }
Пример #2
0
    // 充能百分比取值
    public string getPersnentChargeString(string key)
    {
        if (EntityFactory.MainHeroView == null || !_propertyRatio.ContainsKey(key))
        {
            return(null);
        }

        if (_propertyRatio[key].Count == 0)
        {
            return(null);
        }

        int ratio = _propertyRatio[key][0].nRatio;

        _propertyRatio[key].RemoveAt(0);

        if (!_dicChargeCount.ContainsKey(ratio))
        {
            return("0");
        }
        chargeValue_Info valueInfo = _dicChargeCount[ratio];
        int    value     = valueInfo.chargeValue;
        float  ShowNum   = (float)value * 100 / (getEntityPropertyNum(key) - value);
        string appendNum = string.Format("{0:F1}", ShowNum);

        return(appendNum);
    }