C# Class 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;
Inheritance: ConsoleParser.ICommand
Afficher le fichier Open project: secred/Tachycardia

Méthodes publiques

Méthode Description
Command ( string name ) : System
OnInvoke ( CommandEvent e ) : void
OnTab ( CommandEvent e ) : string

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
OnHelp ( ) : void
OnInvokeParseArg ( CommandEvent &e, int &i ) : void
OnInvokeParseSubArg ( CommandEvent &e, int &i, ArgEvent &evt, string argName ) : void
OnTabGetLastArg ( CommandEvent &e ) : string

Method Details

Command() public méthode

public Command ( string name ) : System
name string
Résultat System

Dummy() protected méthode

protected Dummy ( ArgEvent e ) : void
e ArgEvent
Résultat void

OnInvoke() public méthode

public OnInvoke ( CommandEvent e ) : void
e CommandEvent
Résultat void

OnTab() public méthode

public OnTab ( CommandEvent e ) : string
e CommandEvent
Résultat string

ParseBool() protected méthode

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.
Résultat bool?

ParseFloat() protected méthode

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
Résultat float?

ParseInt() protected méthode

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.
Résultat int?

ParseVector2() protected méthode

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.
Résultat Mogre.Vector2?

ParseVector3() protected méthode

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
Résultat Mogre.Vector3?

ParseVector4() protected méthode

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
Résultat Mogre.Vector4?

RegisterAlias() protected méthode

protected RegisterAlias ( string argName, string aliasName ) : void
argName string
aliasName string
Résultat void

RegisterArg() protected méthode

protected RegisterArg ( string argName, ArgCall call ) : void
argName string
call ArgCall
Résultat void

RegisterArg() protected méthode

protected RegisterArg ( string argName, ArgCall call, string helpString ) : void
argName string
call ArgCall
helpString string
Résultat void

RegisterArgs() protected abstract méthode

protected abstract RegisterArgs ( ) : void
Résultat void

RegisterSubArg() protected méthode

protected RegisterSubArg ( string argName, string subArgName ) : void
argName string
subArgName string
Résultat void