Add more helpers for getting role strings

This commit is contained in:
Atony committed 2026-08-29 22:35:10 -05:00
1 parent 4bdddc6f8a
commit b62b8ae216
1 file changed
+42
+42
View File
@@ -542,6 +542,48 @@ public static class Helpers
return role.NiceName;
}
/// <summary>
/// Returns the string of a <see cref="RoleBehaviour"/>.
/// </summary>
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
/// <returns>The <see cref="RoleBehaviour"/>'s intro blurb.</returns>
public static string GetRoleIntroBlurb(this RoleBehaviour role)
{
if (role is ICustomRole custom)
{
return custom.RoleDescription;
}
return role.Blurb;
}
/// <summary>
/// Returns the string of a <see cref="RoleBehaviour"/>.
/// </summary>
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
/// <returns>The <see cref="RoleBehaviour"/>'s medium description.</returns>
public static string GetRoleMedDescription(this RoleBehaviour role)
{
if (role is ICustomRole custom)
{
return custom.RoleDescription;
}
return role.BlurbMed;
}
/// <summary>
/// Returns the string of a <see cref="RoleBehaviour"/>.
/// </summary>
/// <param name="role">The <see cref="RoleBehaviour"/> to find.</param>
/// <returns>The <see cref="RoleBehaviour"/>'s long description.</returns>
public static string GetRoleLongDescription(this RoleBehaviour role)
{
if (role is ICustomRole custom)
{
return custom.RoleLongDescription;
}
return role.BlurbLong;
}
/// <summary>
/// Returns whether the <see cref="RoleBehaviour"/> is blacklisted from appearing and spawning. (Only applicable to vanilla roles).
/// </summary>