コード例 #1
0
ファイル: BasicAutomaton.cs プロジェクト: MetaColon/Automata
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (States != null ? States.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (InputAlphabet != null ? InputAlphabet.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (InitialState != null ? InitialState.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AcceptStates != null ? AcceptStates.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            if ((InitialState == null || EndState == null))
            {
                return(0);
            }

            unchecked
            {
                int hash = 17;
                hash = hash * 23 + InitialState.GetHashCode();
                hash = hash * 23 + EndState.GetHashCode();
                return(hash);
            }
        }
コード例 #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (ProcessId != null)
         {
             hashCode = hashCode * 59 + ProcessId.GetHashCode();
         }
         if (IdentityId != null)
         {
             hashCode = hashCode * 59 + IdentityId.GetHashCode();
         }
         if (AllowedToEmployeeNames != null)
         {
             hashCode = hashCode * 59 + AllowedToEmployeeNames.GetHashCode();
         }
         if (TransitionTime != null)
         {
             hashCode = hashCode * 59 + TransitionTime.GetHashCode();
         }
         if (Order != null)
         {
             hashCode = hashCode * 59 + Order.GetHashCode();
         }
         if (InitialState != null)
         {
             hashCode = hashCode * 59 + InitialState.GetHashCode();
         }
         if (DestinationState != null)
         {
             hashCode = hashCode * 59 + DestinationState.GetHashCode();
         }
         if (Command != null)
         {
             hashCode = hashCode * 59 + Command.GetHashCode();
         }
         return(hashCode);
     }
 }