C# 클래스 Tachycardia.Tools.Commands.Command

Implements command engine.
In child classes: 1. Write argumets callbacks; 2. Implement RegisterArgs method: 2.1. Register every callback with RegisterArg method. Argument name should be long name. Shorter names should be avaible thought aliases; 2.2. Register every subargument with RegisterSubArg method. Not registered subargs will not be passed to callback; 2.3. Register aliases to callback to shorter typing time;
상속: ConsoleParser.ICommand
파일 보기 프로젝트 열기: secred/Tachycardia

공개 메소드들

메소드 설명
Command ( string name ) : System
OnInvoke ( CommandEvent e ) : void
OnTab ( CommandEvent e ) : string

보호된 메소드들

메소드 설명
Dummy ( ArgEvent e ) : void
ParseBool ( string str, bool &param ) : bool?

Parse str as bool value, update param and return previous param value.

Can parse 'on' and 'off' strings as (respectively) true and false.

ParseFloat ( string str, float &param ) : float?

Parse str as float value, update param and return previous param value.

If the first character of str is '+' or '-', the value of str will be added/substracted to/from param, otherwise value of param will be exactly as in string.

ParseInt ( string str, int &param ) : int?

Parse str as int value, update param and return previous param value.

If the first character of str is '+' or '-', the value of str will be added/substracted to/from param, otherwise value of param will be exactly as in string.

ParseVector2 ( List list, Mogre &param ) : Mogre.Vector2?

Parse list as Mogre::Vector2 value, update param and return previous param value.

If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.

ParseVector3 ( List list, Mogre &value ) : Mogre.Vector3?

Parse list as Mogre::Vector3 value, update param and return previous param value.

If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.

ParseVector4 ( List list, Mogre &value ) : Mogre.Vector4?

Parse list as Mogre::Vector4 value, update param and return previous param value.

If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.

RegisterAlias ( string argName, string aliasName ) : void
RegisterArg ( string argName, ArgCall call ) : void
RegisterArg ( string argName, ArgCall call, string helpString ) : void
RegisterArgs ( ) : void
RegisterSubArg ( string argName, string subArgName ) : void

비공개 메소드들

메소드 설명
OnHelp ( ) : void
OnInvokeParseArg ( CommandEvent &e, int &i ) : void
OnInvokeParseSubArg ( CommandEvent &e, int &i, ArgEvent &evt, string argName ) : void
OnTabGetLastArg ( CommandEvent &e ) : string

메소드 상세

Command() 공개 메소드

public Command ( string name ) : System
name string
리턴 System

Dummy() 보호된 메소드

protected Dummy ( ArgEvent e ) : void
e ArgEvent
리턴 void

OnInvoke() 공개 메소드

public OnInvoke ( CommandEvent e ) : void
e CommandEvent
리턴 void

OnTab() 공개 메소드

public OnTab ( CommandEvent e ) : string
e CommandEvent
리턴 string

ParseBool() 보호된 메소드

Parse str as bool value, update param and return previous param value.
Can parse 'on' and 'off' strings as (respectively) true and false.
protected ParseBool ( string str, bool &param ) : bool?
str string String to parse.
param bool Reference to bool value to update with str content. If parsing fails, this param is not changed.
리턴 bool?

ParseFloat() 보호된 메소드

Parse str as float value, update param and return previous param value.
If the first character of str is '+' or '-', the value of str will be added/substracted to/from param, otherwise value of param will be exactly as in string.
protected ParseFloat ( string str, float &param ) : float?
str string String to parse.
param float
리턴 float?

ParseInt() 보호된 메소드

Parse str as int value, update param and return previous param value.
If the first character of str is '+' or '-', the value of str will be added/substracted to/from param, otherwise value of param will be exactly as in string.
protected ParseInt ( string str, int &param ) : int?
str string String to parse.
param int Reference to int value to update with str content. If parsing fails, this param is not changed.
리턴 int?

ParseVector2() 보호된 메소드

Parse list as Mogre::Vector2 value, update param and return previous param value.
If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.
protected ParseVector2 ( List list, Mogre &param ) : Mogre.Vector2?
list List List of strings with float values to parse. If list lenght is less than 2 parse fails. If list lenght is greater than 2, additional strings will be ignored.
param Mogre Reference to Mogre::Vector2 value to update with list content. If parsing fails, this param is not changed.
리턴 Mogre.Vector2?

ParseVector3() 보호된 메소드

Parse list as Mogre::Vector3 value, update param and return previous param value.
If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.
protected ParseVector3 ( List list, Mogre &value ) : Mogre.Vector3?
list List List of strings with float values to parse. If list lenght is less than 3 parse fails. If list lenght is greater than 3, additional strings will be ignored.
value Mogre
리턴 Mogre.Vector3?

ParseVector4() 보호된 메소드

Parse list as Mogre::Vector4 value, update param and return previous param value.
If the first character of string is '+' or '-', the value of this field will be added/substracted to/from param, otherwise value of param field will be exactly as in string.
protected ParseVector4 ( List list, Mogre &value ) : Mogre.Vector4?
list List List of strings with float values to parse. If list lenght is less than 4 parse fails. If list lenght is greater than 4, additional strings will be ignored.
value Mogre
리턴 Mogre.Vector4?

RegisterAlias() 보호된 메소드

protected RegisterAlias ( string argName, string aliasName ) : void
argName string
aliasName string
리턴 void

RegisterArg() 보호된 메소드

protected RegisterArg ( string argName, ArgCall call ) : void
argName string
call ArgCall
리턴 void

RegisterArg() 보호된 메소드

protected RegisterArg ( string argName, ArgCall call, string helpString ) : void
argName string
call ArgCall
helpString string
리턴 void

RegisterArgs() 보호된 추상적인 메소드

protected abstract RegisterArgs ( ) : void
리턴 void

RegisterSubArg() 보호된 메소드

protected RegisterSubArg ( string argName, string subArgName ) : void
argName string
subArgName string
리턴 void