Media Summary: This 4 lines of code: val piece = chessModel.pieceAt(col, row) if (piece != This is an important design decision. Classes working together should be loosely coupled. We created an interface named ... Half open range "0 until 8" is equivalent to closed range "0..7". We prefer half open range in our for loops.
Android Chess 005 Kotlin Nullable - Detailed Analysis & Overview
This 4 lines of code: val piece = chessModel.pieceAt(col, row) if (piece != This is an important design decision. Classes working together should be loosely coupled. We created an interface named ... Half open range "0 until 8" is equivalent to closed range "0..7". We prefer half open range in our for loops. We do need a singleton of our ChessGame class (was ChessModel in previous videos). Access 7000+ courses for 15 days FREE: Avoid NullPointerException in We started to play with MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE and MotionEvent.ACTION_UP. We'll use them ...
Capture is also handled in this movePiece(..) method. GitHub repo: "Rank" and "File" are terminology used in We also created a mutable set of ChessPiece named piecesBox in ChessModel. GitHub repo: ...