C# Класс 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.
Наследование: IProcess, IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
AddCommand ( Command command ) : void

Adds a new Command to the Behavior

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

Описание методов

AddCondition() защищенный Метод

Adds a new condition to the Behavior
protected AddCondition ( System.Condition condition ) : void
condition System.Condition The Func method that will be tested
Результат void

AddLocalAndServerCommand() защищенный Метод

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
Результат void

AddLocalAndServerCommand() защищенный Метод

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
Результат void

AddLocalAndServerCommand() защищенный Метод

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
Результат void

AddLocalCommand() защищенный Метод

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
Результат void

AddLocalCommand() защищенный Метод

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
Результат void

AddLocalCommand() защищенный Метод

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
Результат void

AddLocalCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

AddServerCommand() защищенный Метод

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
Результат void

Behavior() публичный Метод

public Behavior ( ) : System
Результат System

Dispose() публичный Метод

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
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

Initialize() публичный Метод

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
Результат void

Process() защищенный Метод

protected Process ( float elapsed ) : void
elapsed float
Результат void