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
Показать файл Открыть проект

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

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