Evaluation
public enum Evaluation<T: Score>
Game state evaluation
-
Evaluation of a victory with additional score value
Declaration
Swift
case Victory(T)
-
Evaluation of a defeat with additional score value
Declaration
Swift
case Defeat(T)
-
Evaluation of a draw additional score value
Declaration
Swift
case Draw(T)
-
Evaluation of an ongoing game with additional score value
Declaration
Swift
case Ongoing(T)
-
Checks whether
selfis a not ongoing.Declaration
Swift
public var isFinal: BoolReturn Value
falseiffselfis.Ongoing(_), otherwisetrue -
Checks whether
selfis a victory.Declaration
Swift
public var isVictory: BoolReturn Value
trueiffselfis.Victory(_), otherwisefalse -
Checks whether
selfis a defeat.Declaration
Swift
public var isDefeat: BoolReturn Value
trueiffselfis.Defeat(_), otherwisefalse -
Checks whether
selfis a draw.Declaration
Swift
public var isDraw: BoolReturn Value
trueiffselfis.Draw(_), otherwisefalse -
Inverses
selfby swapping.Victory()with.Defeat()and the value (in all cases).Declaration
Swift
public func inverse() -> EvaluationReturn Value
.Victory(-v)iffselfis.Defeat(v)and vice versa, otherwise.Draw|Ongoing(-v) -
The worst possible evaluation
Declaration
Swift
public static var min: EvaluationReturn Value
.Defeat(-Double.infinity) -
The best possible evaluation
Declaration
Swift
public static var max: EvaluationReturn Value
.Victory(Double.infinity)
Evaluation Enum Reference