Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void newtile_click(object sender, EventArgs e)
- {
- Tile t = (Tile)sender;
- t.Image = Chess.Properties.Resources.green;
- if (greentile != null)
- {
- greentile.Image = null;
- Piece p1 = getpiece(greentile);
- if (p1 != null)
- {
- if (p1.color == Color.White)
- {
- if (p1.rank == Piece.type.pawn)
- {
- drawpiece(t, "♙");
- }
- else if (p1.rank == Piece.type.rook)
- {
- drawpiece(t, "♖");
- }
- else if (p1.rank == Piece.type.knight)
- {
- drawpiece(t, "♘");
- }
- else if (p1.rank == Piece.type.bishop)
- {
- drawpiece(t, "♗");
- }
- else if (p1.rank == Piece.type.queen)
- {
- drawpiece(t, "♕");
- }
- else if (p1.rank == Piece.type.king)
- {
- drawpiece(t, "♔");
- }
- }
- else if (p1.color == Color.Black)
- {
- if (p1.rank == Piece.type.pawn)
- {
- drawpiece(t, "♟");
- }
- else if (p1.rank == Piece.type.rook)
- {
- drawpiece(t, "♜");
- }
- else if (p1.rank == Piece.type.knight)
- {
- drawpiece(t, "♞");
- }
- else if (p1.rank == Piece.type.bishop)
- {
- drawpiece(t, "♝");
- }
- else if (p1.rank == Piece.type.queen)
- {
- drawpiece(t, "♛");
- }
- else if (p1.rank == Piece.type.king)
- {
- drawpiece(t, "♚");
- }
- }
- }
- }
- Piece p = getpiece(t);
- greentile = t;
- p = getpiece(t);
- if (p != null)
- {
- if (p.color == Color.White)
- {
- if (p.rank == Piece.type.pawn)
- {
- drawpiece(t, "♙");
- }
- else if (p.rank == Piece.type.rook)
- {
- drawpiece(t, "♖");
- }
- else if (p.rank == Piece.type.knight)
- {
- drawpiece(t, "♘");
- }
- else if (p.rank == Piece.type.bishop)
- {
- drawpiece(t, "♗");
- }
- else if (p.rank == Piece.type.queen)
- {
- drawpiece(t, "♕");
- }
- else if (p.rank == Piece.type.king)
- {
- drawpiece(t, "♔");
- }
- }
- else if (p.color == Color.Black)
- {
- if (p.rank == Piece.type.pawn)
- {
- drawpiece(t, "♟");
- }
- else if (p.rank == Piece.type.rook)
- {
- drawpiece(t, "♜");
- }
- else if (p.rank == Piece.type.knight)
- {
- drawpiece(t, "♞");
- }
- else if (p.rank == Piece.type.bishop)
- {
- drawpiece(t, "♝");
- }
- else if (p.rank == Piece.type.queen)
- {
- drawpiece(t, "♛");
- }
- else if (p.rank == Piece.type.king)
- {
- drawpiece(t, "♚");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment