Class PlayerParser
Parses a Player reference. Accepts either:
- integer playerid (e.g.
/kick 5) - full player name (case-insensitive)
- name prefix — picks the player with the lowest playerid among matches
Returns the matched EntityId so the command pipeline can convert it to a Player component.
public class PlayerParser : ICommandParameterParser
- Inheritance
-
PlayerParser
- Implements
- Inherited Members
Constructors
PlayerParser()
public PlayerParser()
Methods
TryParse(IServiceProvider, ref StringSpan, out object?)
Tries to parse the next token from inputText.
public bool TryParse(IServiceProvider services, ref StringSpan inputText, out object? result)
Parameters
servicesIServiceProviderService provider (used by parsers that need DI, e.g. PlayerParser).
inputTextStringSpanRemaining input text as a StringSpan. Consumed text is removed by advancing the span.
resultobjectParsed value on success.