toJson method

String toJson()

Converts insanichess.PieceColor to json representation.

Implementation

String toJson() {
  switch (this) {
    case insanichess.PieceColor.white:
      return 'w';
    case insanichess.PieceColor.black:
      return 'b';
  }
}