public override bool Same(ConfigurationIDBase other) { if (!Similar(other)) { return(false); } ConfigurationID otherID = other as ConfigurationID; if (configValues.Count != otherID.configValues.Count) { return(false); } if (configValues.Exists(v => !otherID.configValues.Exists(v2 => v2.typeIndex != v.typeIndex))) { return(false); } if (configValues.Exists(v => otherID.configValues.Exists(v2 => v2.typeIndex == v.typeIndex && v2.ValueIndex != v.ValueIndex))) { return(false); } return(true); }
public override bool Same(ConfigurationIDBase other) { if (!Similar(other)) { return(false); } return(Same(other as ConfigurationID)); }
/// <summary> /// Overlaps this configValues with other.configValues. /// </summary> /// <param name="other"></param> public override void Overlap(ConfigurationIDBase other) { if (!Similar(other)) { return; } Overlap(other as ConfigurationID); }
/// <summary> /// Returns TRUE if all ConfigValues are similar. /// </summary> /// <param name="other"></param> /// <returns></returns> public override bool Similar(ConfigurationIDBase other) { if (other == null) { return(false); } if (other.GetType() != typeof(ConfigurationID)) { return(false); } if (other == this) { return(true); } return(Similar(other as ConfigurationID)); }
void Reset() { _id = GetComponent <ConfigurationIDBase>(); }
/// <summary> /// How this and the other will merge in one. The result should be applied in this. /// </summary> /// <param name="other"></param> public abstract void Overlap(ConfigurationIDBase other);
/// <summary> /// Should return TRUE if this and other have the same values. /// </summary> /// <param name="other"></param> /// <returns></returns> public abstract bool Same(ConfigurationIDBase other);
/// <summary> /// By pairing the values with same type with the other configuration, this should return TRUE if all paired values are either the same or at least one of them is UNDEFINED. /// </summary> /// <param name="other"></param> /// <returns></returns> public abstract bool Similar(ConfigurationIDBase other);
private void Start() { _id = GetComponent <ConfigurationIDBase>(); _lastStatus = Status.None; }
/// <summary> /// Overlaps this configValues with other.configValues. /// </summary> /// <param name="other"></param> public override void Overlap(ConfigurationIDBase other) { Overlap(other as ConfigurationID); }