Renamed new parameters hiding existing members

* Renamed new parameters on methods in AtomicTags and ScriptableObjectVariable that hide existing members.
This commit is contained in:
Jeff Campbell 2019-04-07 11:52:07 +02:00
parent 7763f81ede
commit 7f3b08e887
2 changed files with 21 additions and 21 deletions

View File

@ -86,36 +86,36 @@ namespace UnityAtoms
#endregion
public bool HasTag(string tag)
public bool HasTag(string atomicTag)
{
if (tag == null) return false;
return sortedTags.ContainsKey(tag);
if (atomicTag == null) return false;
return sortedTags.ContainsKey(atomicTag);
}
public void AddTag(StringConstant tag)
public void AddTag(StringConstant atomicTag)
{
if (tag == null || tag.Value == null) return;
if (sortedTags.ContainsKey(tag.Value)) return;
sortedTags.Add(tag.Value, tag);
if (atomicTag == null || atomicTag.Value == null) return;
if (sortedTags.ContainsKey(atomicTag.Value)) return;
sortedTags.Add(atomicTag.Value, atomicTag);
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
// Update static accessors:
if (!taggedGOs.ContainsKey(tag.Value)) taggedGOs.Add(tag.Value, new List<GameObject>());
taggedGOs[tag.Value].Add(this.gameObject);
if (!taggedGOs.ContainsKey(atomicTag.Value)) taggedGOs.Add(atomicTag.Value, new List<GameObject>());
taggedGOs[atomicTag.Value].Add(this.gameObject);
}
public void RemoveTag(string tag)
public void RemoveTag(string atomicTag)
{
if (tag == null) return;
if (sortedTags.ContainsKey(tag)) return;
sortedTags.Remove(tag);
if (atomicTag == null) return;
if (sortedTags.ContainsKey(atomicTag)) return;
sortedTags.Remove(atomicTag);
Tags = new ReadOnlyList<StringConstant>(sortedTags.Values);
// Update static accessors:
if (!taggedGOs.ContainsKey(tag)) return; // this should never happen
taggedGOs[tag].Remove(this.gameObject);
if (!taggedGOs.ContainsKey(atomicTag)) return; // this should never happen
taggedGOs[atomicTag].Remove(this.gameObject);
}
public static GameObject FindByTag(string tag)

View File

@ -23,14 +23,14 @@ namespace UnityAtoms
Changed.Raise(Value);
}
public bool SetValue(T value)
public bool SetValue(T newValue)
{
if (!AreEqual(this.value, value))
if (!AreEqual(value, newValue))
{
this.oldValue = this.value;
this.value = value;
if (Changed != null) { Changed.Raise(value); }
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(this.value, this.oldValue); }
oldValue = value;
value = newValue;
if (Changed != null) { Changed.Raise(newValue); }
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(value, oldValue); }
return true;
}