本文整理汇总了C#中PieceType类的典型用法代码示例。如果您正苦于以下问题:C# PieceType类的具体用法?C# PieceType怎么用?C# PieceType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PieceType类属于命名空间,在下文中一共展示了PieceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Piece
public Piece(bool[,] _data, PieceType _type, TransFormation _trans, Color _color)
{
m_data = _data;
m_type = _type;
m_trans = _trans;
m_color = _color;
}
示例2: Square
public Square(string nam, int num)
{
InitializeComponent();
// Init Obj Rec
InitializeDefinitions();
// Set Square Size
MyTagVisualizer.Height = squareSize;
MyTagVisualizer.Width = squareSize;
// Bring TagVisualizer to the top
MyTagVisualizer.SetCurrentValue(Panel.ZIndexProperty, 5);
// Set internal information
this.name = nam;
this.number = num;
this.piece = PieceType.Empty;
this.Width = squareSize;
this.Height = squareSize;
// Set the Square in the middle
this.SetCurrentValue(Panel.ZIndexProperty, 3);
// Add the Rectangle Layer
rectangle.Width = squareSize;
rectangle.Height = squareSize;
rectangle.Stroke = Brushes.Black;
rectangle.StrokeThickness = 1;
rectangle.Opacity = 0.5;
colourRectangle(Brushes.Transparent);
}
示例3: Piece
public Piece(int x, int y, PieceType type, bool isBlack)
{
_x = x;
_y = y;
_type = type;
_isBlack = isBlack;
}
示例4: Piece
public Piece(PieceType type, Player owner)
{
Type = type;
Owner = owner;
Hex = null;
CanMove = true;
}
示例5: ChessPiece
internal ChessPiece(bool white, PieceType type)
{
this.white = white;
this.type = type;
this.lastMove = 0;
this.lastSquare = new SquareCoordinates(-1, -1);
}
示例6: Piece
public Piece(PlayerColor playerColor, PieceType pieceType, byte x, byte y)
{
playerColorValue = playerColor;
pieceTypeValue = pieceType;
xValue = x;
yValue = y;
}
示例7: Piece
public Piece(string id, string asset, Vector3 position, int colorT, PieceType pieceT)
: base(id, position)
{
_asset = asset;
ColorType = (Colour)colorT;
Piece_Type = pieceT;
}
示例8: ChessPiece
public ChessPiece()
{
gameObject = null;
playerSide = PlayerSide.e_NoneSide;
pieceType = PieceType.e_None;
piecePlayerType = PiecePlayerType.eNone_Piece;
}
示例9: ChessPiece
public ChessPiece(PieceType pieceType, PieceColour pieceColour, int file, int rank)
{
this.pieceType = pieceType;
this.pieceColour = pieceColour;
this.rank = rank;
this.file = file;
}
示例10: Piece
public Piece(PieceType type, PieceColor color, int col, int row, Board board)
{
this.Col = col;
this.Row = row;
this.X = col * Game.TILESIZE;
this.Y = row * Game.TILESIZE;
this.Color = color;
this.Board = board;
FirstMove = true;
SetType(type);
this.MouseDown += delegate(object s, MouseButtonEventArgs ev) {
if (!Game.GameOver && ((!Game.IsConnected && Game.MyTurn(Color)) ||
(Game.IsConnected && Game.MainColor == Color && Game.MyTurn())))
{
dragging = true;
this.Cursor = Cursors.Hand;
System.Windows.Controls.Canvas.SetZIndex(this, 1000);
}
};
this.MouseUp += new MouseButtonEventHandler(image_MouseUp);
this.MouseMove += new MouseEventHandler(image_MouseMove);
this.MouseLeave += new MouseEventHandler(image_MouseMove);
}
示例11: Piece
/// <summary>
/// Instantiate <see cref="Piece"/>
/// </summary>
/// <param name="type"><see cref="Type"/></param>
/// <param name="color"><see cref="Color"/></param>
public Piece(PieceType type, PieceColor color)
{
_type = type;
_color = color;
Moves = new List<Move>();
Attacked = new List<Square>();
}
示例12: ChessPiece
public ChessPiece()
{
gameObject = null;
playerSide = PlayerSide.e_NoneSide;
pieceType = PieceType.e_None;
piecePlayerType = PiecePlayerType.eNone_Piece;
bEnPassantCapture = false;
}
示例13: IsMoveValid
public bool IsMoveValid(int fromRow, int fromColumn, int toRow, int toColumn, PieceType fromPieceType,
PieceType toPieceType, PlayerType playerInTurn)
{
if (IsJumping(fromRow, fromColumn, toRow, toColumn)) return false;
if (!IsOriginValid(fromPieceType, playerInTurn)) return false;
if (!IsMovingForward(fromRow, toRow, playerInTurn)) return false;
return IsDestinationValid(fromColumn, toColumn, toPieceType, playerInTurn);
}
示例14: Piece
public Piece( PieceType type, PieceColor color )
{
if (type == PieceType.None)
throw new ArgumentException("Type must be specified");
if (color == PieceColor.None)
throw new ArgumentException("Color must be specified");
_type = type;
_color = color;
}
示例15: Move
public Move(int from_x, int from_y, int to_x, int to_y, PieceType moved_type, bool promote)
{
this.from_rank = from_x;
this.from_file = from_y;
this.to_rank = to_x;
this.to_file = to_y;
this.promote = promote;
this.moved_type = moved_type;
}