C# Class Indiefreaks.Xna.Logic.Behavior

The Behavior class is responsible of maintaining a list of Conditions and Commands. Conditions are tested every frame and if their aggregated result returns true, the Behavior Commands are executed sequentially.
Inheritance: IProcess, IDisposable
Mostra file Open project: Indiefreaks/igf

Public Methods

Method Description
Behavior ( ) : System
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.

Initialize ( ) : void

Initializes the Behavior

This method is called once the Behavior is added to the Agent's behaviors and associated with the Agent

Protected Methods

Method Description
AddCondition ( System.Condition condition ) : void

Adds a new condition to the Behavior

AddLocalAndServerCommand ( Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void

Adds a Command to this behavior that will be executed on the client and on the server

AddLocalAndServerCommand ( System.Condition condition, Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void

Adds a Command to this behavior that will be executed on the client and on the server

AddLocalAndServerCommand ( System.Condition condition, Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed on the client and on the server

AddLocalCommand ( Command clientCommand ) : void

Adds a Command to this behavior that will be executed solely on the client

AddLocalCommand ( Command clientCommand, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the client

AddLocalCommand ( System.Condition condition, Command clientCommand ) : void

Adds a Command to this behavior that will be executed solely on the client

AddLocalCommand ( System.Condition condition, Command clientCommand, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the client

AddServerCommand ( Command serverExecution ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( Command serverExecution, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( System.Condition condition, Command serverExecution ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( System.Condition condition, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( System.Condition condition, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

AddServerCommand ( System.Condition condition, Command serverExecution, ExecutionFrequency frequency ) : void

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session

Dispose ( bool disposing ) : void
Process ( float elapsed ) : void

Private Methods

Method Description
AddCommand ( Command command ) : void

Adds a new Command to the Behavior

CanProcess ( ) : bool
IProcess ( float elapsed ) : void
UpdateCommandsTick ( float elapsed ) : void

Method Details

AddCondition() protected method

Adds a new condition to the Behavior
protected AddCondition ( System.Condition condition ) : void
condition System.Condition The Func method that will be tested
return void

AddLocalAndServerCommand() protected method

Adds a Command to this behavior that will be executed on the client and on the server
protected AddLocalAndServerCommand ( Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void
clientExecution Command The delegate to the code that will be executed by the client
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
return void

AddLocalAndServerCommand() protected method

Adds a Command to this behavior that will be executed on the client and on the server
protected AddLocalAndServerCommand ( System.Condition condition, Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void
condition System.Condition
clientExecution Command The delegate to the code that will be executed by the client
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
return void

AddLocalAndServerCommand() protected method

Adds a Command to this behavior that will be executed on the client and on the server
protected AddLocalAndServerCommand ( System.Condition condition, Command clientExecution, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void
condition System.Condition
clientExecution Command The delegate to the code that will be executed by the client
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
frequency ExecutionFrequency
return void

AddLocalCommand() protected method

Adds a Command to this behavior that will be executed solely on the client
protected AddLocalCommand ( Command clientCommand ) : void
clientCommand Command The delegate to the code that will be executed by the client
return void

AddLocalCommand() protected method

Adds a Command to this behavior that will be executed solely on the client
protected AddLocalCommand ( Command clientCommand, ExecutionFrequency frequency ) : void
clientCommand Command The delegate to the code that will be executed by the client
frequency ExecutionFrequency
return void

AddLocalCommand() protected method

Adds a Command to this behavior that will be executed solely on the client
protected AddLocalCommand ( System.Condition condition, Command clientCommand ) : void
condition System.Condition
clientCommand Command The delegate to the code that will be executed by the client
return void

AddLocalCommand() protected method

Adds a Command to this behavior that will be executed solely on the client
protected AddLocalCommand ( System.Condition condition, Command clientCommand, ExecutionFrequency frequency ) : void
condition System.Condition
clientCommand Command The delegate to the code that will be executed by the client
frequency ExecutionFrequency
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( Command serverExecution ) : void
serverExecution Command The delegate to the code that will be executed by the server
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
frequency ExecutionFrequency
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( Command serverExecution, ExecutionFrequency frequency ) : void
serverExecution Command The delegate to the code that will be executed by the server
frequency ExecutionFrequency
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( System.Condition condition, Command serverExecution ) : void
condition System.Condition
serverExecution Command The delegate to the code that will be executed by the server
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( System.Condition condition, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions ) : void
condition System.Condition
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( System.Condition condition, Command serverExecution, Command applyServerResult, Type dataType, DataTransferOptions dataTransferOptions, ExecutionFrequency frequency ) : void
condition System.Condition
serverExecution Command The delegate to the code that will be executed by the server
applyServerResult Command The delegate to the code that will be executed by all clients in the session when server returns
dataType System.Type The Type of the data exchanged between the clients and server
dataTransferOptions DataTransferOptions Tells how the command orders are transfered throught the network
frequency ExecutionFrequency
return void

AddServerCommand() protected method

Adds a Command to this behavior that will be executed solely on the server and returned to all clients in the session
protected AddServerCommand ( System.Condition condition, Command serverExecution, ExecutionFrequency frequency ) : void
condition System.Condition
serverExecution Command The delegate to the code that will be executed by the server
frequency ExecutionFrequency
return void

Behavior() public method

public Behavior ( ) : System
return System

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

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Initialize() public method

Initializes the Behavior
This method is called once the Behavior is added to the Agent's behaviors and associated with the Agent
public Initialize ( ) : void
return void

Process() protected method

protected Process ( float elapsed ) : void
elapsed float
return void