示例#1
0
    void CheckSuit(int id)
    {
        if (GetSuitAmount(id) == 5)
        {
            suit_id = id;

            var commond = SuitConfig.Get(id).suit_function.Split(';');
            foreach (var c in commond)
            {
                GameStaticMethod.ExecuteCommond(c);
            }
        }
        else
        {
            if (suit_id != -1)
            {
                var commond = SuitConfig.Get(suit_id).suit_function.Split(';');
                foreach (var c in commond)
                {
                    GameStaticMethod.ExecuteBackCommond(c);
                }
                suit_id = -1;
            }
        }
    }
示例#2
0
    public override string GetTipString()
    {
        var           type   = GetType();
        var           fields = type.GetFields();
        StringBuilder sb     = new StringBuilder();
        SortedDictionary <int, string> dict = new SortedDictionary <int, string>();

        foreach (var field in fields)
        {
            var tip_attribute = field.GetCustomAttribute(typeof(TipAttribute));
            if (tip_attribute != null)
            {
                var attribute = (tip_attribute as TipAttribute);
                if (attribute.showName == "")
                {
                    attribute.showName = field.Name;
                }

                var valueStr = DreamerTool.Util.DreamerUtil.GetColorRichText(field.GetValue(this).ToString(), attribute.valueColor);
                dict.Add(attribute.index, attribute.showName + ": " + valueStr + "\n");
            }
        }
        foreach (var item in dict)
        {
            if (item.Key < 3)
            {
                sb.Append("\t\t\t\t\t");
            }
            if (item.Key == 3)
            {
                sb.Append("\n");
            }
            if (item.Key == int.MaxValue)
            {
                sb.Append(SuitConfig.Get(物品ID).GetItemUITipStr() + "\n");
            }
            sb.Append(item.Value);
        }
        return(sb.ToString());
    }