notnil / chess

chess package for go
MIT License
521 stars 135 forks source link

feat: Expose getPiece as GetPiece #107

Closed barakmich closed 2 years ago

barakmich commented 2 years ago

Currently, there's no way to build a *chess.Piece from the constituent PieceType and Color... it's useful, as it exists in the package already, so it seems nice to make this helper function public.

bbars commented 2 years ago

Sounds a bit confusing. Its name should be NewPiece, doesn't it?

notnil commented 2 years ago

I have actually run into this myself using the package. A worthy addition. Thanks @barakmich . I used @bbars suggestion on naming to be compliant with typical NewXXX naming conventions.