Sanguosha.Core.Cards.CardAttribute.Register C# (CSharp) Method

Register() public static method

public static Register ( string attributeName ) : CardAttribute
attributeName string
return CardAttribute
        public static CardAttribute Register(string attributeName)
        {
            if (_attributeNames == null)
            {
                _attributeNames = new Dictionary<string, CardAttribute>();
            }
            if (_attributeNames.ContainsKey(attributeName))
            {
                throw new DuplicateAttributeKeyException(attributeName);
            }
            var attr = new CardAttribute(attributeName);
            _attributeNames.Add(attributeName, attr);
            return attr;
        }