withPainLevel method
Implementation
Body withPainLevel(String partId, int painLevel) {
final part = allPartsById[partId];
if (part == null) {
return this;
}
final newPain = part.pain.copyWith(
painLevel: painLevel.clamp(0, maxPainLevel),
);
return withPain(partId, newPain);
}