예제 #1
0
파일: GenericState.cs 프로젝트: ohadc7/Ex2A
            /// <summary>
            /// Gets the state.
            /// </summary>
            /// <param name="stateContent">Content of the state.</param>
            /// <returns>GenericState&lt;T&gt;.</returns>
            public static GenericState <T> GetState(T stateContent)
            {
                if (StatesHashTable.ContainsKey(stateContent))
                {
                    return(StatesHashTable[stateContent]);
                }
                var newState = new GenericState <T>(stateContent);

                StatesHashTable.Add(stateContent, newState);
                return(newState);
            }
예제 #2
0
파일: GenericState.cs 프로젝트: ohadc7/Ex2A
 /// <summary>
 /// Equalses the specified s according to its content.
 /// </summary>
 /// <param name="s">The s.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 public bool Equals(GenericState <T> s)
 {
     return(StateContent.Equals(s.StateContent));
 }