Esempio n. 1
0
 public static string SetTextAttributes(ATTRS attribute, COLORS foregroundColor, COLORS backgroundColor)
 {
     return(ESC + String.Format("[{0};{1};{2}m",
                                (int)attribute,
                                (int)foregroundColor,
                                (int)backgroundColor));
 }
Esempio n. 2
0
    public void SetAttr(ATTRS attr, int value, bool isAdd)
    {
        int difVal = AttrSys.SetAttr(ref attrs, attr, value, isAdd);

        if (isRole())
        {
            string dif = difVal >= 0 ? "增加" : "减少";
            AddMessage(entityName + " 属性" + AttrSys.GetAttrName(attr) + dif + value.ToString());
        }
        setInfo();
        // attrs = value;
    }
Esempio n. 3
0
    static public int SetAttr(ref int[] attrs, ATTRS attr, int value, bool isAdd)
    {
        int index = (int)attr;
        int old   = attrs[index];

        if (isAdd)
        {
            attrs[index] += value;
        }
        else
        {
            attrs[index] = value;
        }

        return(attrs[index] - old);
    }
Esempio n. 4
0
 public int GetAttr(ATTRS index)
 {
     return(attrs[(int)index]);
 }
Esempio n. 5
0
 public static string SetTextAttributes(ATTRS attribute)
 {
     return(ESC + String.Format("[{0}m",
                                (int)attribute));
 }
Esempio n. 6
0
 static public string GetAttrName(ATTRS index)
 {
     return(ATTRSTING[(int)index]);
 }
Esempio n. 7
0
 public static string SetTextAttributes(ATTRS attribute)
 {
     return ESC + String.Format("[{0}m",
                                (int) attribute);
 }
Esempio n. 8
0
 public static string SetTextAttributes(ATTRS attribute, COLORS foregroundColor, COLORS backgroundColor)
 {
     return ESC + String.Format("[{0};{1};{2}m",
                                (int) attribute,
                                (int) foregroundColor,
                                (int) backgroundColor);
 }