From 4811afb52c511565d2b13f36ed645243c7557803 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 2 Sep 2020 11:08:17 +0200 Subject: board generation --- Pieces/Pawn.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Pieces/Pawn.cs (limited to 'Pieces/Pawn.cs') diff --git a/Pieces/Pawn.cs b/Pieces/Pawn.cs new file mode 100644 index 0000000..d518b8e --- /dev/null +++ b/Pieces/Pawn.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Chess.Pieces +{ + class Pawn : ChessPiece + { + public Pawn() + { + PieceImage = new Bitmap(Chess.Properties.Resources.b_pawn_png_shadow_256px); + } + + public override void Draw(Graphics graphics, float x, float y, float tileWidth, float tileHeight) + { + if (PieceImage != null) + { + var image = this.ResizeImage(PieceImage, (int)tileWidth, (int)tileHeight); + + graphics.DrawImage(image, new PointF(x*tileWidth, y*tileHeight)); + + image.Dispose(); + } + } + + public override bool MoveTo() + { + throw new NotImplementedException(); + } + } +} -- cgit v1.2.3-70-g09d2