示例#1
0
        public static CardInfoAttribute Get(object obj)
        {
            Type _type = obj.GetType();

            foreach (FieldInfo _field in _type.GetFields())
            {
                CardInfoAttribute _attribute = Attribute.GetCustomAttribute(_field, typeof(CardInfoAttribute)) as CardInfoAttribute;

                if (_attribute == null)
                {
                    continue;
                }

                if (!obj.Equals(_field.GetValue(null)))
                {
                    continue;
                }

                return(_attribute);
            }

            return(null);
        }
示例#2
0
文件: Card.cs 项目: eserozvataf/poker
 public string GetValueName()
 {
     return(CardInfoAttribute.Get(this.m_CardValue).Name);
 }
示例#3
0
文件: Card.cs 项目: eserozvataf/poker
 public string GetTypeName()
 {
     return(CardInfoAttribute.Get(this.m_CardType).Name);
 }
示例#4
0
文件: Card.cs 项目: eserozvataf/poker
 public int GetValuePriority()
 {
     return(CardInfoAttribute.Get(this.m_CardValue).Priority);
 }
示例#5
0
文件: Card.cs 项目: eserozvataf/poker
 public int GetTypePriority()
 {
     return(CardInfoAttribute.Get(this.m_CardType).Priority);
 }