[This is preliminary documentation and is subject to change.]
A text scanner that aids parsing chat commands and their arguments.
Breaks up a message into tokens at spaces. Treats quoted strings as whole tokens.
Namespace: fCraftAssembly: fCraft (in fCraft.dll) Version: 0.6.3.2 (0.6.3.2)
Syntax
| C# |
public sealed class CommandReader : ICloneable
Members
| All Members | Constructors | Fields | Properties | Methods |
| Member | Description | |
|---|---|---|
| CommandReader(String) | Creates a command from a raw message. | |
| CommandReader(CommandReader) | Creates a copy of an existing command. | |
| Clone()()()() | Creates a copy of this command.
Use the copy constructor instead of this, if possible. | |
| Count | Counts the total number of arguments.
Does not modify the offset. | |
| CountRemaining | Counts the number of arguments left in this command.
Does not modify the offset. | |
| Descriptor | Command descriptor associated with this command.
May be null of command was not recognized by name. | |
| Equals(Object) | (Inherited from Object.) | |
| Finalize()()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
| GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| HasInt | Checks whether there there is an int argument available.
Does not modify the offset. | |
| HasNext | Checks whether there is another argument available.
Does not modify the offset. | |
| IsConfirmed | Whether this command has been confirmed by the user (with /ok) | |
| MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| Name | Name (lowercase) of the command. | |
| Next()()()() | Returns the next command argument.
A single "argument" is either a word that ends with whitespace,
or several words in double quotes (""). | |
| NextAll()()()() | Returns the rest of command's text, from current offset to the end of string.
If there is nothing to return (i.e. if string ends at the current offset),
returns empty string. | |
| NextBlock(Player, Boolean, Block%) | Parses next parameter as a Minecraft block name.
Messages warnings directly to the player in case of problems. | |
| NextBlockWithParam(Player, Boolean, Block%, Int32%) | Parses next parameter as a Minecraft block name.
Allows an optional integer parameter to follow the block name after a slash, e.g. "BlockName/#"
Messages warnings directly to the player in case of problems. | |
| NextInt(Int32%) | Returns the next command argument, parsed as an integer. | |
| Offset | Gets or sets current offset, in characters, from the beginning of the raw message. | |
| RawMessage | Raw message that is being parsed, including the slash and the command name. | |
| Rewind()()()() | Resets the argument offset.
After calling Rewind, arguments can be read from the beginning again. | |
| ToString()()()() | (Overrides Object..::..ToString()()()().) |