C# Class fCraft.CommandReader

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.
Inheritance: ICloneable
Afficher le fichier Open project: fragmer/fCraft Class Usage Examples

Méthodes publiques

Свойство Type Description
IsConfirmed bool

Private Properties

Свойство Type Description
Next string
NextAll string
NextBlock bool
NextInt bool
ToString string

Méthodes publiques

Méthode Description
Clone ( ) : object

Creates a copy of this command. Use the copy constructor instead of this, if possible.

CommandReader ( [ other ) : System

Creates a copy of an existing command.

NextBlockWithParam ( [ player, bool allowNoneBlock, Block &block, int &param ) : bool

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.

NextOnOff ( bool &param ) : bool

Reads a token and gets an "on" (1) or "off" (0) input from command.

Rewind ( ) : void

Resets the argument offset. After calling Rewind, arguments can be read from the beginning again.

Private Methods

Méthode Description
Next ( ) : string
NextAll ( ) : string
NextBlock ( [ player, bool allowNoneBlock, Block &block ) : bool
NextInt ( int &number ) : bool
ToString ( ) : string

Method Details

Clone() public méthode

Creates a copy of this command. Use the copy constructor instead of this, if possible.
public Clone ( ) : object
Résultat object

CommandReader() public méthode

Creates a copy of an existing command.
public CommandReader ( [ other ) : System
other [
Résultat System

NextBlockWithParam() public méthode

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.
public NextBlockWithParam ( [ player, bool allowNoneBlock, Block &block, int &param ) : bool
player [ Player to send warnings to (if any come up).
allowNoneBlock bool Whether "none"/"skip" blocktype is allowed.
block Block On success, this is set to the given block type. /// On failure, this is set to Block.None
param int Optional integer parameter. Set to 1 if not given.
Résultat bool

NextOnOff() public méthode

Reads a token and gets an "on" (1) or "off" (0) input from command.
public NextOnOff ( bool &param ) : bool
param bool if user gave "on" or "1", this is set to true. /// Otherwise (if "off" or "0" is given, if nothing was given, /// or if an unrecognized string was given) this is set to false.
Résultat bool

Rewind() public méthode

Resets the argument offset. After calling Rewind, arguments can be read from the beginning again.
public Rewind ( ) : void
Résultat void

Property Details

IsConfirmed public_oe property

public bool IsConfirmed
Résultat bool