当前位置: 首页>>代码示例>>C#>>正文


C# PieceType类代码示例

本文整理汇总了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;
 }
开发者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


注:本文中的PieceType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。