In my application I added a Map<Piece,String> which I used to get the FAN representation of each Piece, such as "♜" and "♙". Then I figured it would actually be a very useful feature if this library would just give me those symbols. I dug into the code and found that it already has a feature like that in the MoveList class, but it's just not public.
This pull request improves the Piece enum by adding several new methods: getSanSymbol(), getFanSymbol(), getFenSymbol(), and fromFenSymbol(String). I think these additions also simplify the internal structure of the code, because you need fewer lookup tables in different classes. I was, in fact, able to mark some fields and methods in the Constants class as deprecated. I didn't dare to delete them, as someone may depend on them.
In my application I added a
Map<Piece,String>
which I used to get the FAN representation of eachPiece
, such as "♜" and "♙". Then I figured it would actually be a very useful feature if this library would just give me those symbols. I dug into the code and found that it already has a feature like that in theMoveList
class, but it's just not public.This pull request improves the
Piece
enum by adding several new methods:getSanSymbol()
,getFanSymbol()
,getFenSymbol()
, andfromFenSymbol(String)
. I think these additions also simplify the internal structure of the code, because you need fewer lookup tables in different classes. I was, in fact, able to mark some fields and methods in theConstants
class as deprecated. I didn't dare to delete them, as someone may depend on them.