+ public Map<Square, ColorPiece> getSquares(SquareSort sorting) {
+ if (sorting == null)
+ sorting = SquareSort.defaultSort();
+
+ TreeMap<Square, ColorPiece> sortedSquares = new TreeMap<>(
+ sorting.comparator()
+ );
+ sortedSquares.putAll(squares);
+
+ return sortedSquares;
+ }
+
+ @Override