Module: Sashite::Feen::Dumper::StyleTurn
- Defined in:
- lib/sashite/feen/dumper/style_turn.rb
Overview
Dumper for the style-turn field (third field of FEEN).
Converts a Styles object into its FEEN string representation, encoding game styles and indicating the active player.
Constant Summary collapse
- STYLE_SEPARATOR =
Style separator in style-turn field.
"/"
Class Method Summary collapse
-
.dump(styles) ⇒ String
Dump a Styles object into its FEEN style-turn string.
Class Method Details
.dump(styles) ⇒ String
Dump a Styles object into its FEEN style-turn string.
Formats the active and inactive player styles with the active player’s style appearing first. The case of each style identifier indicates which player uses it (uppercase = first player, lowercase = second player).
37 38 39 |
# File 'lib/sashite/feen/dumper/style_turn.rb', line 37 def self.dump(styles) "#{styles.active}#{STYLE_SEPARATOR}#{styles.inactive}" end |