makePiece function

int makePiece(
  1. int piece,
  2. int colour, {
  3. int internalType = 0,
  4. bool initialState = false,
  5. int flags = 0,
})

Implementation

int makePiece(
  int piece,
  int colour, {
  int internalType = 0,
  bool initialState = false,
  int flags = 0,
}) =>
    (flags << Bishop.flagsStartBit) +
    (initialState ? 1 << Bishop.initialStateBit : 0) +
    (internalType << 10) +
    (piece << 2) +
    colour;