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
Afficher le fichier Open project: Indiefreaks/igf

Méthodes publiques

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

Méthodes protégées

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

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

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

AddLocalAndServerCommand() protected méthode

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
Résultat void

AddLocalAndServerCommand() protected méthode

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
Résultat void

AddLocalAndServerCommand() protected méthode

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
Résultat void

AddLocalCommand() protected méthode

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
Résultat void

AddLocalCommand() protected méthode

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
Résultat void

AddLocalCommand() protected méthode

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
Résultat void

AddLocalCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

AddServerCommand() protected méthode

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
Résultat void

Behavior() public méthode

public Behavior ( ) : System
Résultat System

Dispose() public méthode

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
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Initialize() public méthode

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
Résultat void

Process() protected méthode

protected Process ( float elapsed ) : void
elapsed float
Résultat void