mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Some doc comments for type abbreviations.
This commit is contained in:
@@ -5,6 +5,9 @@ using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace Robust.Shared.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility class for abbreviating common type names.
|
||||
/// </summary>
|
||||
public static class TypeAbbreviation
|
||||
{
|
||||
private static readonly Abbreviation[] _abbreviations;
|
||||
@@ -26,6 +29,11 @@ namespace Robust.Shared.Utility
|
||||
_abbreviations = ParseAbbreviations((YamlSequenceNode) document.RootNode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to abbreviate a full type name into something shorter.
|
||||
/// </summary>
|
||||
/// <param name="name">The type name to abbreviate.</param>
|
||||
/// <returns>A shorter, but still unique, version of the passed type name.</returns>
|
||||
public static string Abbreviate(ReadOnlySpan<char> name)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# Config file for the abbreviations system (TypeAbbreviations.cs).
|
||||
# Format should be pretty self explanatory.
|
||||
# Each abbreviation has a long, a short and (optionally) a list of sub abbreviations.
|
||||
# The sub abbreviations get tried if their owner passed.
|
||||
# Only one abbreviation can pass in a set of abbreviations
|
||||
# (and then that passing one's sub abbreviations get considered).
|
||||
|
||||
- long: "System"
|
||||
short: "S"
|
||||
sub:
|
||||
|
||||
Reference in New Issue
Block a user