public override bool Equals(NetworkSyncItem obj) { if (obj.GetType() != this.GetType()) { return(false); } NetworkSyncVarValue other = (NetworkSyncVarValue)obj; List <NetworkSyncItem> otherList = other.Value; if (Value.Count != otherList.Count) { return(false); } bool allEqual = true; for (int i = 0; i < Value.Count; i++) { allEqual = allEqual && (Value[i].Equals(otherList[i])); } return(allEqual); }
public override bool Equals(NetworkSyncItem obj) { if (obj.GetType() != this.GetType()) { return(false); } return(this.Value == ((NetworkSyncFloat)obj).Value); }
public void Assign(NetworkSyncItem val) { if (currentItem != null) { prevItem = currentItem; } else { prevItem = val; } currentItem = val; }
public override bool Equals(NetworkSyncItem obj) { if (obj.GetType() != this.GetType()) { return(false); } List <string> otherList = ((NetworkSyncStringList)obj).Value; if (Value.Count != otherList.Count) { return(false); } bool allEqual = true; for (int i = 0; i < Value.Count; i++) { allEqual = allEqual && (Value[i].Equals(otherList[i])); } return(allEqual); }
public override bool Equals(NetworkSyncItem obj) { return(obj.GetType() == typeof(NetworkSyncPass)); }
public abstract bool Equals(NetworkSyncItem obj);
public void Equalize() { prevItem = currentItem; }
public SyncVar(string name, NetworkSyncItem item) { VariableName = name; this.Assign(item); }