public void AddTag(TagBase tag, KeyConflictResolutionKind conflictResolution) { Log.Info($"Adding tag to {Owner.RenderForLog()}: '{tag.RenderForLog()}'."); ConflictResolverBase conflictResolver = ConflictResolverBase.GetResolver(this, conflictResolution); conflictResolver.AddTag(tag); }
private CopyTagsEffect(IDeserializer deserializer) : base(deserializer) { TagKey = deserializer.GetValue <string>(nameof(TagKey)); TagScope = deserializer.GetValue <TagScope>(nameof(TagScope)); TagKeyMatchKind = deserializer.GetValue <MatchKind>(nameof(TagKeyMatchKind)); NewTagKey = deserializer.GetValue <string>(nameof(NewTagKey)); ConflictResolution = deserializer.GetValue <KeyConflictResolutionKind>(nameof(ConflictResolution)); }
public CopyTagsEffect(string tagKey, MatchKind tagKeyMatchKind, TagScope tagScope, ConditionBase condition, string newTagKey, KeyConflictResolutionKind conflictResolution, EffectTarget target) : base(condition, target) { TagKey = tagKey; TagKeyMatchKind = tagKeyMatchKind; TagScope = tagScope; NewTagKey = newTagKey; ConflictResolution = conflictResolution; }
private CopyTagsEffectViewModel(string tagKey, MatchKind tagKeyMatchKind, TagScope tagScope, string newTagKey, KeyConflictResolutionKind conflictResolution, ConditionViewModelBase condition, EffectTarget target) : base(condition, target) { m_tagKey = tagKey; m_tagKeyMatchKind = tagKeyMatchKind; m_tagScope = tagScope; m_newTagKey = newTagKey; m_conflictResolution = conflictResolution; }
private AddTagEffectViewModel(TagViewModelBase tag, KeyConflictResolutionKind conflictResolution, ConditionViewModelBase condition, EffectTarget target) : base(condition, target) { m_tag = tag; m_conflictResolution = conflictResolution; }
public CopyTagsEffect(string tagKey, TagScope tagScope, string newTagKey, KeyConflictResolutionKind conflictResolution) : this(tagKey, MatchKind.Exact, tagScope, AlwaysCondition.True, newTagKey, conflictResolution, EffectTarget.Defender) { }
private AddTagEffect(IDeserializer deserializer) : base(deserializer) { Tag = deserializer.GetValue <TagBase>(nameof(Tag)); ConflictResolution = deserializer.GetValue <KeyConflictResolutionKind>(nameof(ConflictResolution)); }
public AddTagEffect(TagBase tag, KeyConflictResolutionKind conflictResolution, ConditionBase condition, EffectTarget target) : base(condition, target) { Tag = tag; ConflictResolution = conflictResolution; }
public AddTagEffect(TagBase tag, KeyConflictResolutionKind conflictResolution) : this(tag, conflictResolution, AlwaysCondition.True, EffectTarget.Defender) { }
public static ConflictResolverBase GetResolver(TagCollection tagCollection, KeyConflictResolutionKind conflictResolution) { switch (conflictResolution) { case KeyConflictResolutionKind.Add: return(new AddConflictResolver(tagCollection.m_tags, tagCollection.Owner)); case KeyConflictResolutionKind.Subtract: return(new SubtractConflictResolver(tagCollection.m_tags, tagCollection.Owner)); case KeyConflictResolutionKind.KeepAll: return(new KeepAllConflictResolver(tagCollection.m_tags, tagCollection.Owner)); case KeyConflictResolutionKind.KeepLarger: return(new KeepLargerConflictResolver(tagCollection.m_tags, tagCollection.Owner)); case KeyConflictResolutionKind.KeepSmaller: return(new KeepSmallerConflictResolver(tagCollection.m_tags, tagCollection.Owner)); case KeyConflictResolutionKind.Replace: return(new ReplaceConflictResolver(tagCollection.m_tags, tagCollection.Owner)); default: throw new ArgumentOutOfRangeException(nameof(conflictResolution), $"No conflict resolver available for resolution kind {conflictResolution}"); } }