Exemplo n.º 1
0
 private void DrawPieces(Graphics g)
 {
     foreach (Coordinate coord in Context.Layout.Keys)
     {
         var getImage = ChessPieceImage.GetInstance(Context.Layout[coord].Type, Context.Layout[coord].Color);
         g.DrawImage(getImage, coord.X * CellSize, coord.Y * CellSize, CellSize, CellSize);
     }
 }
Exemplo n.º 2
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            CurrentMove = new Move();

            CurrentMove.StartPosition = MouseOverCoordinate;
            if (Context.Layout.ContainsKey(MouseOverCoordinate))
            {
                CurrentMove.piece = Context.Layout[MouseOverCoordinate];
                Cursor            = new Cursor(ChessPieceImage.GetInstance(CurrentMove.piece.Type, CurrentMove.piece.Color).GetHicon());
            }
            movement = true;
        }