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

View File

@ -23,14 +23,14 @@ namespace UnityAtoms
Changed.Raise(Value); 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; oldValue = value;
this.value = value; value = newValue;
if (Changed != null) { Changed.Raise(value); } if (Changed != null) { Changed.Raise(newValue); }
if (ChangedWithHistory != null) { ChangedWithHistory.Raise(this.value, this.oldValue); } if (ChangedWithHistory != null) { ChangedWithHistory.Raise(value, oldValue); }
return true; return true;
} }