示例#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);
        }
示例#2
0
 /// <summary>
 /// Hash code for the object.
 /// </summary>
 public override int GetHashCode()
 {
     return(Part.GetHashCode() ^ module.GetHashCode());
 }
示例#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());
示例#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}]";