yes
This commit is contained in:
@@ -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 ? "♚" : "♔"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user