예제 #1
0
        /// <summary>
        /// ハッシュコードを取得します。
        /// </summary>
        public override int GetHashCode()
        {
            // ValueType.GetHashCodeは遅いらしい。。。
            if (IsSpecialMove)
            {
                return(SpecialMoveType.GetHashCode());
            }
            else
            {
                var baseHashCode =
                    BWType.GetHashCode() ^
                    SameAsOld.GetHashCode() ^
                    RelFileType.GetHashCode() ^
                    RankMoveType.GetHashCode() ^
                    ActionType.GetHashCode() ^
                    (Piece != null ? Piece.GetHashCode() : 0) ^
                    (SrcSquare != null ? SrcSquare.GetHashCode() : 0);

                if (SameAsOld)
                {
                    return(baseHashCode);
                }
                else
                {
                    return(
                        baseHashCode ^
                        File.GetHashCode() ^
                        Rank.GetHashCode());
                }
            }
        }
예제 #2
0
 /// <summary>
 /// 駒の相対位置を文字列に変換します。
 /// </summary>
 public static string ToString(RelFileType relFileType)
 {
     return(RelPosTypeTable[relFileType]);
 }
예제 #3
0
 /// <summary>
 /// 駒の相対位置を文字列に変換します。
 /// </summary>
 public static string ToString(RelFileType relFileType)
 {
     return RelPosTypeTable[relFileType];
 }