public void RemoveTags(string key, MatchKind keyMatchKind) { var tagKeys = string.Join(", ", m_tags.Where(x => MatchKindUtility.IsMatch(x.Key, key, keyMatchKind, false)).Select(x => x.Key)); Log.Info($"Removing tag from {Owner.RenderForLog()}: '{tagKeys}'."); m_tags.RemoveAll(x => MatchKindUtility.IsMatch(x.Key, key, keyMatchKind, false)); }
protected override void ApplyEffectsCore(AttackState state, TagCollection target) { foreach (var tag in state.GetTags(TagScope)) { if (MatchKindUtility.IsMatch(tag.Key, TagKey, TagKeyMatchKind, false)) { var newTag = tag.CloneWithKey(NewTagKey); target.AddTag(newTag, ConflictResolution); } } }
public override bool IsTrue(AttackState state) { return(state.GetTags(MatchScopes) .Where(x => MatchKindUtility.IsMatch(x.Key, MatchKey, KeyMatchKind, false)) .Any(IsTagValueMatch)); }
public static IEnumerable <TagBase> GetTags(this IEnumerable <TagBase> tags, string match, MatchKind matchKind) { return(tags.EmptyIfNull().Where(x => MatchKindUtility.IsMatch(x.Key, match, matchKind, false))); }