From 7d8992e0cacc6c9a9ddeaec4a99c96a52b39348b Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 5 Jan 2020 15:42:20 +0100 Subject: [PATCH] Some doc comments for type abbreviations. --- Robust.Shared/Utility/TypeAbbreviation.cs | 8 ++++++++ Robust.Shared/Utility/TypeAbbreviations.yaml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/Robust.Shared/Utility/TypeAbbreviation.cs b/Robust.Shared/Utility/TypeAbbreviation.cs index c40b7a0919..81a3a801b6 100644 --- a/Robust.Shared/Utility/TypeAbbreviation.cs +++ b/Robust.Shared/Utility/TypeAbbreviation.cs @@ -5,6 +5,9 @@ using YamlDotNet.RepresentationModel; namespace Robust.Shared.Utility { + /// + /// Utility class for abbreviating common type names. + /// public static class TypeAbbreviation { private static readonly Abbreviation[] _abbreviations; @@ -26,6 +29,11 @@ namespace Robust.Shared.Utility _abbreviations = ParseAbbreviations((YamlSequenceNode) document.RootNode); } + /// + /// Attempt to abbreviate a full type name into something shorter. + /// + /// The type name to abbreviate. + /// A shorter, but still unique, version of the passed type name. public static string Abbreviate(ReadOnlySpan name) { var sb = new StringBuilder(); diff --git a/Robust.Shared/Utility/TypeAbbreviations.yaml b/Robust.Shared/Utility/TypeAbbreviations.yaml index 79ed28f186..9c1d30d26c 100644 --- a/Robust.Shared/Utility/TypeAbbreviations.yaml +++ b/Robust.Shared/Utility/TypeAbbreviations.yaml @@ -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: