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 self is a not ongoing.

    Declaration

    Swift

    public var isFinal: Bool

    Return Value

    false iff self is .Ongoing(_), otherwise true

  • Checks whether self is a victory.

    Declaration

    Swift

    public var isVictory: Bool

    Return Value

    true iff self is .Victory(_), otherwise false

  • Checks whether self is a defeat.

    Declaration

    Swift

    public var isDefeat: Bool

    Return Value

    true iff self is .Defeat(_), otherwise false

  • Checks whether self is a draw.

    Declaration

    Swift

    public var isDraw: Bool

    Return Value

    true iff self is .Draw(_), otherwise false

  • Inverses self by swapping .Victory() with .Defeat() and the value (in all cases).

    Declaration

    Swift

    public func inverse() -> Evaluation

    Return Value

    .Victory(-v) iff self is .Defeat(v) and vice versa, otherwise .Draw|Ongoing(-v)

  • min

    The worst possible evaluation

    Declaration

    Swift

    public static var min: Evaluation

    Return Value

    .Defeat(-Double.infinity)

  • max

    The best possible evaluation

    Declaration

    Swift

    public static var max: Evaluation

    Return Value

    .Victory(Double.infinity)