This commit is contained in:
cdricms
2024-09-16 15:20:02 +02:00
parent 8335db5888
commit b04ecceb9f
5 changed files with 32 additions and 4 deletions

View File

@@ -1,6 +1,19 @@
final class King: Piece {
typealias Threats = (Piece?, Piece?)
var threats: Threats = (nil, nil)
internal private(set) var threats: Threats = (nil, nil)
func insertThreat(_ piece: Piece) {
if threats.0 == nil {
threats.0 = piece
return
}
if threats.1 == nil {
threats.1 = piece
return
}
}
override var unicodeRepresentation: String {
return color == .Black ? "" : ""
}