本文整理汇总了C#中Castle.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# Castle.HasFlag方法的具体用法?C# Castle.HasFlag怎么用?C# Castle.HasFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle
的用法示例。
在下文中一共展示了Castle.HasFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reset
public void Reset(PlayerPieceSet white_pieces,
PlayerPieceSet black_pieces,
Players player_to_move,
Castle white_castling_options,
Castle black_castling_options,
int? capture_en_passant_column,
ushort fullmove_number,
ushort halfmove_clock)
{
Debug.Assert(white_pieces != null);
Debug.Assert(black_pieces != null);
Debug.Assert(m_white_pieces == null);
Debug.Assert(m_black_pieces == null);
m_white_pieces = white_pieces;
m_black_pieces = black_pieces;
m_position_flags.Clear();
if (player_to_move == Players.White)
{
m_position_flags.SetBit(BIT_WHITE_TO_MOVE);
}
// TODO - HasFlag is known to be slow, consider optimizing
SetCanCastleShort(Players.White, white_castling_options.HasFlag(Castle.Short));
SetCanCastleLong(Players.White, white_castling_options.HasFlag(Castle.Long));
SetCanCastleShort(Players.Black, black_castling_options.HasFlag(Castle.Short));
SetCanCastleLong(Players.Black, black_castling_options.HasFlag(Castle.Long));
CaptureEnPassantColumn = capture_en_passant_column;
FullmoveNumber = fullmove_number;
HalfmoveClock = halfmove_clock;
}