Class: Sashite::Cpn::Turn
- Inherits:
-
Object
- Object
- Sashite::Cpn::Turn
- Defined in:
- lib/sashite/cpn/turn.rb
Overview
Turn class.
Instance Method Summary collapse
-
#initialize(b) ⇒ Turn
constructor
A new instance of Turn.
-
#to_s ⇒ String
A string representation.
-
#turn_to_topside? ⇒ Boolean
Returns false when the turn to play is for bottom.
Constructor Details
#initialize(b) ⇒ Turn
Returns a new instance of Turn.
8 9 10 |
# File 'lib/sashite/cpn/turn.rb', line 8 def initialize(b) @b = b end |
Instance Method Details
#to_s ⇒ String
Returns A string representation.
18 19 20 21 22 23 24 |
# File 'lib/sashite/cpn/turn.rb', line 18 def to_s if turn_to_topside? 't' else 'B' end end |
#turn_to_topside? ⇒ Boolean
Returns false when the turn to play is for bottom.
13 14 15 |
# File 'lib/sashite/cpn/turn.rb', line 13 def turn_to_topside? @b end |