Program a chess game in C# | Part 2 – Positions and orientations

Program a chess game in C# | Part 2 – Positions and orientations

HomeOttoBotCodeProgram a chess game in C# | Part 2 – Positions and orientations
Program a chess game in C# | Part 2 – Positions and orientations
ChannelPublish DateThumbnail & View CountDownload Video
Channel AvatarPublish Date not found Thumbnail
0 Views
Learn how to program a chess game in C#!

Welcome to the second part of my C# Chess tutorial.
In this part, we add some simple classes to the ChessLogic project:
– A player enumeration to store the rotating players, the winning player as well as the color of the chess pieces.
– A Position class which represents a position (or a square) on the board.
– A Direction class which will be very useful for implementing the movement of each part.

Assets:
https://ottobotcode.com/chess/ChessAssets.zip

The source code is available here:
https://www.patreon.com/OttoBotCode/shop/78701

Chapters:
0:00 – Plan
0:29 – Player listing
1:25 – Find an opponent
3:39 – Position class
5:07 – Find the color of a square
6:10 – Replace Equals and GetHashCode
6:58 – Directing class
8:22 – Combine directions
9:28 – Directions of the ladder
10:10 a.m. – Predefined directions
12:22 – Translate position
13:53 – Usage example

Please take the opportunity to connect and share this video with your friends and family if you find it useful.