make_pretty method

Map<String, dynamic> make_pretty(
  1. Move ugly_move
)

pretty = external move object

Implementation

Map<String, dynamic> make_pretty(Move ugly_move) {
  final map = <String, dynamic>{};
  map['san'] = move_to_san(ugly_move);
  map['to'] = ugly_move.toAlgebraic;
  map['from'] = ugly_move.fromAlgebraic;
  map['captured'] = ugly_move.captured;

  var flags = '';
  for (var flag in BITS.keys) {
    if ((BITS[flag]! & ugly_move.flags) != 0) {
      flags += FLAGS[flag]!;
    }
  }
  map['flags'] = flags;

  return map;
}