SanSerialization

public class SanSerialization

SAN moves serialization and deserialization.

  • SanSerialization object with default settings.

    Declaration

    Swift

    public static let `default`: SanSerialization

Serialization

  • Serialize move to SAN string.

    Declaration

    Swift

    public func san(for move: Move, in game: Game) -> String

    Parameters

    move

    Move object that sould be serialized.

    game

    A game which is about to make a given move.

    Return Value

    SAN string describing given move.

Deserialization

  • Deserialize move from given SAN string.

    Declaration

    Swift

    public func move(for san: String, in game: Game) -> Move

    Parameters

    san

    String containing SAN move.

    game

    A game which is about to make a given SAN move.

    Return Value

    Move object initialized from given SAN string.