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);
        }
예제 #2
0
 public override bool Same(ConfigurationIDBase other)
 {
     if (!Similar(other))
     {
         return(false);
     }
     return(Same(other as ConfigurationID));
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 void Reset()
 {
     _id = GetComponent <ConfigurationIDBase>();
 }
예제 #6
0
 /// <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);
예제 #7
0
 /// <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);
예제 #8
0
 /// <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);
 }