C# Класс 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.
Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
IsConfirmed bool

Private Properties

Свойство Тип Описание
Next string
NextAll string
NextBlock bool
NextInt bool
ToString string

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
Next ( ) : string
NextAll ( ) : string
NextBlock ( [ player, bool allowNoneBlock, Block &block ) : bool
NextInt ( int &number ) : bool
ToString ( ) : string

Описание методов

Clone() публичный Метод

Creates a copy of this command. Use the copy constructor instead of this, if possible.
public Clone ( ) : object
Результат object

CommandReader() публичный Метод

Creates a copy of an existing command.
public CommandReader ( [ other ) : System
other [
Результат System

NextBlockWithParam() публичный Метод

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.
Результат bool

NextOnOff() публичный Метод

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.
Результат bool

Rewind() публичный Метод

Resets the argument offset. After calling Rewind, arguments can be read from the beginning again.
public Rewind ( ) : void
Результат void

Описание свойств

IsConfirmed публичное свойство

public bool IsConfirmed
Результат bool