bishbosh-0.1.4.0: Plays chess.
Safe HaskellNone
LanguageHaskell2010

BishBosh.Rule.GameTerminationReason

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Itemises the various reasons for terminating a game.
  • Each reason corresponds to a rule in chess.
Synopsis

Types

Data-types

data GameTerminationReason Source #

The sum-type of ways in which a game can legally be terminated.

Instances

Instances details
Eq GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Ord GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Read GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Show GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

NFData GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Methods

rnf :: GameTerminationReason -> () #

FixedMembership GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Opposable GameTerminationReason Source # 
Instance details

Defined in BishBosh.Rule.GameTerminationReason

Functions

toResult :: GameTerminationReason -> Result Source #

Convert to a result.

Constructors

Predicates

isCheckMateBy :: LogicalColour -> GameTerminationReason -> Bool Source #

Whether the game was won by the specified player.

isCheckMate :: GameTerminationReason -> Bool Source #

Whether the game terminated in check-mate.

isResignation :: GameTerminationReason -> Bool Source #

Whether the game was resigned.

isDraw :: GameTerminationReason -> Bool Source #

Whether the game was drawn.