public PlayerAttribute this[object key] { get { if (!internalAttributes.ContainsKey(key)) { var attribute = new PlayerAttribute(this.Name, this.autoReset, this.isMark, this.isStatus); attribute.internalKey = key; internalAttributes.Add(key, attribute); } return internalAttributes[key]; } }
public int this[PlayerAttribute key] { get { if (!attributes.ContainsKey(key)) { return 0; } else { return attributes[key]; } } set { if (!attributes.ContainsKey(key)) { attributes.Add(key, value); } else if (attributes[key] == value) { return; } attributes[key] = value; OnPropertyChanged("Attributes"); } }
public void CalldownCleanupCrew(ISkill skill, PlayerAttribute attr) { if (!markCleanup.ContainsKey(skill)) markCleanup.Add(skill, new List<PlayerAttribute>()); markCleanup[skill].Add(attr); }
public void RegisterMarkCleanup(ISkill skill, PlayerAttribute attr) { cleanupSquad.CalldownCleanupCrew(skill, attr); }
public static PlayerAttribute Register(string attributeName, bool autoReset = false, bool isAMark = false, bool isStatus = false) { if (_attributeNames == null) { _attributeNames = new Dictionary<string, PlayerAttribute>(); } if (_attributeNames.ContainsKey(attributeName)) { return _attributeNames[attributeName]; //throw new DuplicateAttributeKeyException(attributeName); } var attr = new PlayerAttribute(attributeName, autoReset, isAMark, isStatus); _attributeNames.Add(attributeName, attr); return attr; }