本文整理汇总了C#中PieceType类的典型用法代码示例。如果您正苦于以下问题:C# PieceType类的具体用法?C# PieceType怎么用?C# PieceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PieceType类属于命名空间,在下文中一共展示了PieceType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:sbvild,项目名称:tetris,代码行数:7,代码来源:Piece.cs
示例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);
}
开发者ID:TomHulme,项目名称:P4P,代码行数:26,代码来源:Square.xaml.cs
示例3: Piece
public Piece(int x, int y, PieceType type, bool isBlack)
{
_x = x;
_y = y;
_type = type;
_isBlack = isBlack;
}
开发者ID:ChessProjectDP1,项目名称:ChessProjectCode,代码行数:7,代码来源:Piece.cs
示例4: Piece
public Piece(PieceType type, Player owner)
{
Type = type;
Owner = owner;
Hex = null;
CanMove = true;
}
开发者ID:epicvrvs,项目名称:Shashkrid,代码行数:7,代码来源:Piece.cs
示例5: ChessPiece
internal ChessPiece(bool white, PieceType type)
{
this.white = white;
this.type = type;
this.lastMove = 0;
this.lastSquare = new SquareCoordinates(-1, -1);
}
开发者ID:Kevin-Jin,项目名称:kvj-board-games,代码行数:7,代码来源:ChessPieces.cs
示例6: Piece
public Piece(PlayerColor playerColor, PieceType pieceType, byte x, byte y)
{
playerColorValue = playerColor;
pieceTypeValue = pieceType;
xValue = x;
yValue = y;
}
开发者ID:Rickie26k,项目名称:Chesstwonk,代码行数:7,代码来源:Piece.cs
示例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;
}
开发者ID:TalonTwist,项目名称:3DBraveChess,代码行数:7,代码来源:Piece.cs
示例8: ChessPiece
public ChessPiece()
{
gameObject = null;
playerSide = PlayerSide.e_NoneSide;
pieceType = PieceType.e_None;
piecePlayerType = PiecePlayerType.eNone_Piece;
}
开发者ID:chichikov,项目名称:chichikov76,代码行数:7,代码来源:ChessPiece.cs
示例9: ChessPiece
public ChessPiece(PieceType pieceType, PieceColour pieceColour, int file, int rank)
{
this.pieceType = pieceType;
this.pieceColour = pieceColour;
this.rank = rank;
this.file = file;
}
开发者ID:FreddyFlares,项目名称:Zebra,代码行数:7,代码来源:ChessPiece.cs
示例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);
}
开发者ID:jluispcardenas,项目名称:ChessTest,代码行数:27,代码来源:Piece.cs
示例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>();
}
开发者ID:gabehaack,项目名称:Chess,代码行数:13,代码来源:Piece.cs
示例12: ChessPiece
public ChessPiece()
{
gameObject = null;
playerSide = PlayerSide.e_NoneSide;
pieceType = PieceType.e_None;
piecePlayerType = PiecePlayerType.eNone_Piece;
bEnPassantCapture = false;
}
开发者ID:chichikov,项目名称:chichikov,代码行数:8,代码来源:ChessPiece.cs
示例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);
}
开发者ID:simsoll,项目名称:FlexibleReliableSoftware,代码行数:9,代码来源:StandardMovementStrategy.cs
示例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;
}
开发者ID:Keboo,项目名称:PGNSharp,代码行数:9,代码来源:Piece.cs
示例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;
}
开发者ID:ShawnHouCHN,项目名称:Csharp-AI-XiaoshenHou,代码行数:9,代码来源:MoveGenerator.cs
示例16: SpawnPiece
private void SpawnPiece(PlayerType p, PieceType t, Position pos, Transform parent)
{
GameObject go = Instantiate(piecePrefab) as GameObject;
Piece piece = go.GetComponent<Piece>();
go.transform.parent = parent;
piece.Set(p, t, pos);
GameController.Instance.board.GetField(pos).Occupy(piece);
}
开发者ID:Spierek,项目名称:SpyChess,代码行数:9,代码来源:BoardGenerator.cs
示例17: Piece
/// <summary>
/// Piece constructor
/// </summary>
/// <param name="position">The position on the game board</param>
/// <param name="type">The type piece</param>
/// <param name="side">The side (team)</param>
/// <param name="texturePath">A relative path to an image file</param>
/// <param name="directionVector">A list of vectors defining the movement pattern of the piece</param>
/// <param name="moveReach">How many steps the piece can move</param>
public Piece(Point position, PieceType type, Side side, string texturePath, List<Point> directionVector, int moveReach)
{
this.position = position;
this.type = type;
this.side = side;
LoadTexture(texturePath);
this.directionVector = directionVector;
this.moveReach = moveReach;
}
开发者ID:TriFaceDude,项目名称:TDDD49,代码行数:18,代码来源:Piece.cs
示例18: LoadPiece
public void LoadPiece(PieceType type, Drawable piece)
{
Bitmap bitmap = Bitmap.CreateBitmap (piece_size, piece_size, Bitmap.Config.Argb8888);
Canvas canvas = new Canvas (bitmap);
piece.SetBounds (0, 0, piece_size, piece_size);
piece.Draw (canvas);
piece_bitmaps[(int)type] = bitmap;
}
开发者ID:Hackemate,项目名称:Snake,代码行数:10,代码来源:PieceView.cs
示例19: Piece
public Piece(PieceType type, int x, int y)
{
if (0 > x || x > 7)
throw new ArgumentOutOfRangeException("x", "Invalid x position");
if (0 > y || y > 7)
throw new ArgumentOutOfRangeException("x", "Invalid y position");
ChessType = type;
X = x;
Y = y;
}
开发者ID:xu007,项目名称:Gen_Checkmate,代码行数:11,代码来源:Piece.cs
示例20: Piece
public Piece(PieceType type)
{
if (type == PieceType.Straight)
pieces = new List<Texture>()
{
DrawManager.CreateTexture("Tetris - Blue Piece", "Blue Piece", Vector2.Zero, DrawManager.ImagePosition.TopLeft),
DrawManager.CreateTexture("Tetris - Blue Piece", "Blue Piece", DrawManager.GetTexture("Tetris - Blue Piece").Width(), DrawManager.ImagePosition.TopLeft),
DrawManager.CreateTexture("Tetris - Blue Piece", "Blue Piece", 2 * DrawManager.GetTexture("Tetris - Blue Piece").Width(), DrawManager.ImagePosition.TopLeft),
DrawManager.CreateTexture("Tetris - Blue Piece", "Blue Piece", 3 * DrawManager.GetTexture("Tetris - Blue Piece").Width(), DrawManager.ImagePosition.TopLeft),
};
}
开发者ID:Sicryption,项目名称:EloBuddyAddons,代码行数:11,代码来源:Piece.cs
注:本文中的PieceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论