Module: Sashite::Feen::Dumper
- Defined in:
- lib/sashite/feen/dumper.rb,
lib/sashite/feen/dumper/style_turn.rb,
lib/sashite/feen/dumper/pieces_in_hand.rb,
lib/sashite/feen/dumper/piece_placement.rb
Overview
Dumper for FEEN (Forsyth–Edwards Enhanced Notation) positions.
Converts a Position object into its canonical FEEN string representation by delegating serialization to specialized dumpers for each component.
Defined Under Namespace
Modules: PiecePlacement, PiecesInHand, StyleTurn
Constant Summary collapse
- FIELD_SEPARATOR =
Field separator in FEEN notation.
" "- FIELD_COUNT =
Number of fields in a FEEN string.
3
Class Method Summary collapse
-
.dump(position) ⇒ String
Dump a Position object into its canonical FEEN string representation.
Class Method Details
.dump(position) ⇒ String
Dump a Position object into its canonical FEEN string representation.
Generates a deterministic FEEN string from a position object. The same position will always produce the same canonical string.
33 34 35 36 37 38 39 40 41 |
# File 'lib/sashite/feen/dumper.rb', line 33 def self.dump(position) fields = [ Dumper::PiecePlacement.dump(position.placement), Dumper::PiecesInHand.dump(position.hands), Dumper::StyleTurn.dump(position.styles) ] join_fields(fields) end |