evaluatePosition function

int evaluatePosition(
  1. Position p
)

Static evaluation from the side-to-move's perspective, in centipawns.

No terminal/draw detection here — the search owns that (it scores mate and stalemate from an empty move list and handles the 50-move rule / repetition).

Implementation

int evaluatePosition(Position p) {
  final white_ =
      _materialPstWhitePov(p) + _extendedWhitePov(p) + _mopUpWhitePov(p);
  return p.turn == white ? white_ : -white_;
}