C# Class Indiefreaks.Xna.Logic.Command

The Command class encapsulates methods that will be executed by the current session when necessary A Command instance contains a clientExecution delegate that is executed on the player machine when set to Local and LocalAndServer. The serverExecution gets called on the session host when set to Server. Finally, the ApplyServerResult is called back on all players when the ServerExecution delegate returns. Each Command is identified by its Id that is automatically generated by the Session so that Remote Command calls are always consistent.
Inheritance: IDisposable
Mostra file Open project: Indiefreaks/igf Class Usage Examples

Public Methods

Method Description
Command ( System.Condition condition, ClientCommand clientExecution, ServerCommand serverExecution, ApplyServerCommand applyServerResult, CommandType comandType, Type networkValueType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : System

Creates a new Command instance

CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateLocalCommand ( ClientCommand clientCommand ) : Command
CreateLocalCommand ( ClientCommand clientCommand, ExecutionFrequency frequency ) : Command
CreateLocalCommand ( System.Condition condition, ClientCommand clientCommand ) : Command
CreateLocalCommand ( System.Condition condition, ClientCommand clientCommand, ExecutionFrequency frequency ) : Command
CreateServerCommand ( System.Condition condition, ServerCommand serverCommand ) : Command
CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ExecutionFrequency frequency ) : Command
CreateServerCommand ( ServerCommand serverCommand ) : Command
CreateServerCommand ( ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
CreateServerCommand ( ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
CreateServerCommand ( ServerCommand serverCommand, ExecutionFrequency frequency ) : Command
Dispose ( ) : void

Exécute les tâches définies par l'application associées à la libération ou à la redéfinition des ressources non managées.

Private Methods

Method Description
Dispose ( bool disposing ) : void
Process ( float elapsed ) : void
UpdateTick ( float elapsed ) : void

Method Details

Command() public method

Creates a new Command instance
public Command ( System.Condition condition, ClientCommand clientExecution, ServerCommand serverExecution, ApplyServerCommand applyServerResult, CommandType comandType, Type networkValueType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : System
condition System.Condition
clientExecution ClientCommand The method that will be executed
serverExecution ServerCommand
applyServerResult ApplyServerCommand
comandType CommandType The CommandType of this Command
networkValueType System.Type The type of the value that is returned by the Execution delegate, if the command doesn't returns a value, you can set this to null to limit network data transfer
dataTransferOptions DataTransferOptions Defines options for network packet transmission
frequency ExecutionFrequency Defines the frequency at which the current command will be processed
return System

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
clientCommand ClientCommand
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
clientCommand ClientCommand
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
clientCommand ClientCommand
serverCommand ServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
clientCommand ClientCommand
serverCommand ServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
condition System.Condition
clientCommand ClientCommand
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
condition System.Condition
clientCommand ClientCommand
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
condition System.Condition
clientCommand ClientCommand
serverCommand ServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateLocalAndServerCommand() public static method

public static CreateLocalAndServerCommand ( System.Condition condition, ClientCommand clientCommand, ServerCommand serverCommand, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
condition System.Condition
clientCommand ClientCommand
serverCommand ServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateLocalCommand() public static method

public static CreateLocalCommand ( ClientCommand clientCommand ) : Command
clientCommand ClientCommand
return Command

CreateLocalCommand() public static method

public static CreateLocalCommand ( ClientCommand clientCommand, ExecutionFrequency frequency ) : Command
clientCommand ClientCommand
frequency ExecutionFrequency
return Command

CreateLocalCommand() public static method

public static CreateLocalCommand ( System.Condition condition, ClientCommand clientCommand ) : Command
condition System.Condition
clientCommand ClientCommand
return Command

CreateLocalCommand() public static method

public static CreateLocalCommand ( System.Condition condition, ClientCommand clientCommand, ExecutionFrequency frequency ) : Command
condition System.Condition
clientCommand ClientCommand
frequency ExecutionFrequency
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( System.Condition condition, ServerCommand serverCommand ) : Command
condition System.Condition
serverCommand ServerCommand
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
condition System.Condition
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
condition System.Condition
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( System.Condition condition, ServerCommand serverCommand, ExecutionFrequency frequency ) : Command
condition System.Condition
serverCommand ServerCommand
frequency ExecutionFrequency
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( ServerCommand serverCommand ) : Command
serverCommand ServerCommand
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions ) : Command
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( ServerCommand serverCommand, ApplyServerCommand applyServerResult, Type typeOfDataExchanged, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : Command
serverCommand ServerCommand
applyServerResult ApplyServerCommand
typeOfDataExchanged System.Type
dataTransferOptions DataTransferOptions
frequency ExecutionFrequency
return Command

CreateServerCommand() public static method

public static CreateServerCommand ( ServerCommand serverCommand, ExecutionFrequency frequency ) : Command
serverCommand ServerCommand
frequency ExecutionFrequency
return Command

Dispose() public method

Exécute les tâches définies par l'application associées à la libération ou à la redéfinition des ressources non managées.
public Dispose ( ) : void
return void