C# Class idTech4.idCmdSystem

Console command execution and command text buffering.
Any number of commands can be added in a frame from several different sources. Most commands come from either key bindings or console line input, but entire text files can be exec'ed.

Command execution takes a string, breaks it into tokens, then searches for a command or variable that matches the first token.

Show file Open project: iainmckay/idtech4.net

Public Methods

Method Description
AddCommand ( string name, string description, CommandFlags flags, EventHandler handler ) : void

Registers a command and the delegate to call for it.

AddCommand ( string name, string description, CommandFlags flags, EventHandler handler, EventHandler completionHandler ) : void

Registers a command and the delegate to call for it.

ArgCompletion_ConfigName ( object sender, CommandCompletionEventArgs e ) : void
BufferCommandArgs ( Execute exec, idCmdArgs args ) : void
BufferCommandText ( Execute exec, string text ) : void

Adds command text to the command buffer.

BufferCommandText ( string text ) : void

Adds command text to the command buffer.

CommandCompletion ( Predicate filter ) : string[]
ExecuteCommandBuffer ( ) : void
Init ( ) : void
idCmdSystem ( ) : System

Private Methods

Method Description
AppendCommandText ( string text ) : void
Cmd_Echo ( object sender, CommandEventArgs e ) : void

Just prints the rest of the line to the console.

Cmd_Exec ( object sender, CommandEventArgs e ) : void
Cmd_ListAllCommands ( object sender, CommandEventArgs e ) : void
Cmd_ListGameCommands ( object sender, CommandEventArgs e ) : void
Cmd_ListRendererCommands ( object sender, CommandEventArgs e ) : void
Cmd_ListSoundCommands ( object sender, CommandEventArgs e ) : void
Cmd_ListSystemCommands ( object sender, CommandEventArgs e ) : void
Cmd_ListToolCommands ( object sender, CommandEventArgs e ) : void
Cmd_Parse ( object sender, CommandEventArgs e ) : void

This just prints out how the rest of the line was parsed, as a debugging tool.

Cmd_VStr ( object sender, CommandEventArgs e ) : void

Inserts the current value of a cvar as command text.

Cmd_Wait ( object sender, CommandEventArgs e ) : void

Causes execution of the remainder of the command buffer to be delayed until next frame.

ExecuteCommandText ( string text ) : void
ExecuteTokenizedString ( idCmdArgs args ) : void
InsertCommandText ( string text ) : void
ListByFlags ( idCmdArgs args, CommandFlags flags ) : void

Method Details

AddCommand() public method

Registers a command and the delegate to call for it.
public AddCommand ( string name, string description, CommandFlags flags, EventHandler handler ) : void
name string
description string
flags CommandFlags
handler EventHandler
return void

AddCommand() public method

Registers a command and the delegate to call for it.
public AddCommand ( string name, string description, CommandFlags flags, EventHandler handler, EventHandler completionHandler ) : void
name string
description string
flags CommandFlags
handler EventHandler
completionHandler EventHandler
return void

ArgCompletion_ConfigName() public static method

public static ArgCompletion_ConfigName ( object sender, CommandCompletionEventArgs e ) : void
sender object
e CommandCompletionEventArgs
return void

BufferCommandArgs() public method

public BufferCommandArgs ( Execute exec, idCmdArgs args ) : void
exec Execute
args idCmdArgs
return void

BufferCommandText() public method

Adds command text to the command buffer.
public BufferCommandText ( Execute exec, string text ) : void
exec Execute
text string
return void

BufferCommandText() public method

Adds command text to the command buffer.
public BufferCommandText ( string text ) : void
text string
return void

CommandCompletion() public method

public CommandCompletion ( Predicate filter ) : string[]
filter Predicate
return string[]

ExecuteCommandBuffer() public method

public ExecuteCommandBuffer ( ) : void
return void

Init() public method

public Init ( ) : void
return void

idCmdSystem() public method

public idCmdSystem ( ) : System
return System