Join Anton Delsink for an in-depth discussion in this video Add members of class ChessMove, part of Object Oriented Programming with C#.
- [Instructor] So because my focus is now the move,…the individual move that I want to study,…I'm going to oversimplify the representation of the board…and the chess pieces.…So forgive me for copying and pasting for a moment.…I'll go to the ChessMove class.…And here above our method,…I'll paste in an enum for the ChessPieces themselves…and an array representing the InitialBoard.…And so, I'll place my cursor right at the top…of the ChessMove class and paste,…and you have the same text available in the solution file…for your use as well.…
So with these two copy and pasted pieces of code,…I can represent the initial chessboard configuration…as a two-dimensional array of ChessPieces,…and these ChessPieces will simply enum.…They're not actually a whole object with any complexity.…Now, do note in ChessPieces, they are on line nine.…I do have a placeholder in the enum…for when a square on the chessboard is empty.…And so, we can check for ChessPieces that None to see…whether a square is available.…So let's implement our Try move method.…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.