/** * @param MoveInterface $move * @param GameInterface $game * * @throws InvalidMoveException */ public static function enrich(MoveInterface $move, GameInterface $game) { if ($move->getPiece() === null) { $move->setPiece($game->getBoard()->getSquare($move->getFrom())->getPiece()); } self::validate($move, $game); if (!$move->getType()) { $move->setType(self::determineType($move, $game)); } }