Question: Instructions: 1- Create a C# class library project in a blank solution, name it whatever you like. 2- Chess pieces can either be white or

Instructions:

1- Create a C# class library project in a blank solution, name it whatever you like.

2- Chess pieces can either be white or black create an enum named color or colour where Black = 1, and White = 2.

3- Each side (color) in Chess has 16 pieces; 8 pawns, 2 bishops, 2 knights, 2 rooks, 1 queen, and 1 king. Create an enum named pieces where pawn1 =1 . pawn8 = 8, bishop1 = 9, bishop2 =10 and so on.

4- Create a public class called named Piece with two data members (fields); 1- color, 2-type. Make sure you include properties (get, set). a. Within the class Piece override the ToString method to output the color and the type.

5- Create a public class called ChessPieces similar to the Deck class from the demonstration. a. Implement a default constructor that calls a method named Reset. Reset just creates the pieces for each color (side) and places them in a list. i. Unlike the Deck class, you will have two lists, one list for black pieces and one list for white pieces. b. Implement a method named GetPiece that does the exact same thing TakeCard() does in the demonstration.

6- Just like we did in the demonstration, create a new console project within the current solution and name it whatever you like. b. Make sure you add a project reference.

7- The console project will contain a main method that uses the method GetPiece 12 times and outputs what the piece is using the ToString method in the Piece class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!