Class: SGF::Renderer
- Inherits:
-
Object
- Object
- SGF::Renderer
- Defined in:
- lib/sgf/renderer.rb
Overview
Renderer is called by a client program to render client object in SGF format.
Instance Method Summary collapse
Instance Method Details
#render_node(node) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sgf/renderer.rb', line 5 def render_node node raise 'INCOMPLETE' result = "" if type == NODE_SETUP unless black_moves.empty? end unless white_moves.empty? end else result << (color == BLACK ? "B" : "W") result << "[" << "" << "]" end result << "C[" << comment << "]" unless comment.nil? result end |