C# Class BalloonsPop.Core.Commands.CommandFactory

Implements a factory to create commands.
Inheritance: ICommandFactory
Show file Open project: Baloons-Pop-4/Main Class Usage Examples

Public Methods

Method Description
CommandFactory ( ) : System

Initializes a new instance of the CommandFactory class.

ContainsKey ( string commandKey ) : bool

A method to check if the command is already created.

CreateCommand ( string commandName ) : ICommand

A method to create a command.

RegisterCommand ( string commandKey, Func commandProvidingMethod ) : void

A method to register a new command.

UnregisterCommand ( string commandKey ) : void

A method to delete a command.

Private Methods

Method Description
RegisterDefaults ( ) : void

A method to register default commands.

Method Details

CommandFactory() public method

Initializes a new instance of the CommandFactory class.
public CommandFactory ( ) : System
return System

ContainsKey() public method

A method to check if the command is already created.
public ContainsKey ( string commandKey ) : bool
commandKey string
return bool

CreateCommand() public method

A method to create a command.
public CreateCommand ( string commandName ) : ICommand
commandName string
return ICommand

RegisterCommand() public method

A method to register a new command.
public RegisterCommand ( string commandKey, Func commandProvidingMethod ) : void
commandKey string
commandProvidingMethod Func
return void

UnregisterCommand() public method

A method to delete a command.
public UnregisterCommand ( string commandKey ) : void
commandKey string
return void