Beispiel #1
0
        /// <summary>
        /// Hash the docking ports.
        /// </summary>
        public override int GetHashCode()
        {
            int hash = part.GetHashCode() ^ port.GetHashCode();

            if (shield != null)
            {
                hash ^= shield.GetHashCode();
            }
            if (portNameModule != null)
            {
                hash ^= portNameModule.GetHashCode();
            }
            if (portNameField != null)
            {
                hash ^= portNameField.GetHashCode();
            }
            return(hash);
        }
Beispiel #2
0
 /// <summary>
 /// Hash code for the object.
 /// </summary>
 public override int GetHashCode()
 {
     return(Part.GetHashCode() ^ module.GetHashCode());
 }
Beispiel #3
0
 public static string GetID(this PartModule part_module) =>
 part_module == null ?
 "_part_module" :
 string.Format("{0}:{1}[{2:X}]",
               part_module.part.GetID(),
               part_module.ClassName, part_module.GetHashCode());
Beispiel #4
0
 public static string GetID(this PartModule part_module) =>
 part_module == null
         ? "_part_module"
         : $"{GetID(part_module.part)}:{part_module.GetType().Name}[{part_module.GetHashCode():X}]";