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
파일 보기 프로젝트 열기: fragmer/fCraft 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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