BodyType is a list with body types as keys and numbers as values in the game's code. Whenever a body has to be drawn it does indeed "automatically search" the body type in some way, but the body type's locations are hardcoded so there's little searching to do.
private const string NakedBodyTextureFolderPath = "Things/Pawn/Humanlike/Bodies/";
public static Graphic GetNakedBodyGraphic(BodyType bodyType, Shader shader, Color skinColor)
{
if (bodyType == BodyType.Undefined)
{
Log.Error("Getting naked body graphic with undefined body type.");
bodyType = BodyType.Male;
}
string str = "Naked_" + bodyType.ToString();
string path = "Things/Pawn/Humanlike/Bodies/" + str;
return GraphicDatabase.Get<Graphic_Multi>(path, shader, Vector2.one, skinColor);
}
When deciding which type of clothing to use, the game just adds "_" + body type to a clothing's graphic path.
path = apparel.def.apparel.wornGraphicPath + "_" + bodyType.ToString();