C# Class Myre.Entities.Behaviours.Behaviour

An abstract class which represents specific functionality which an Entity can perform.

Behaviours effectively tag an entity as performing some task. They may contain private working data, and gather references to required properties. They should not contain logic, as that is handled by the behaviours' manager.

Each Scene has a behaviour manager for each type of behaviour. This manager performs any updating or drawing for all behaviours of the relevant type.

Afficher le fichier Open project: martindevans/Myre Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
CreateProperties ( System.Entity context ) : void

Initialises this instance.

CreatePropeties is called once when the entity is constructed. Here the behaviour should create any properties required by this behaviour to function. Create properties is called before Initialise.

GetFullPropertyName ( string propertyName ) : string
Initialise ( INamedDataProvider initialisationData ) : void

Initialises this instance.

Initialise/Shutdown may be called multiple times, as the instance is recycled. Here the behaviour should do any setup needed to put the behaviour into its' initial state, including getting optional properties from the entity which may have been created by other behaviours, and register to any services. Initialise is called before the behaviour is added to the manager.

Shutdown ( INamedDataProvider shutdownData ) : void

Shuts down this instance.

Initialise/Shutdown may be called multiple times, as the instance is recycled. Shutdown is called after the behaviour has been removed from the manager.

Méthodes protégées

Méthode Description
Behaviour ( ) : System
Behaviour ( string name ) : System
Initialised ( ) : void

Indicates that this instance has all been initialised

Method Details

Behaviour() protected méthode

protected Behaviour ( ) : System
Résultat System

Behaviour() protected méthode

protected Behaviour ( string name ) : System
name string
Résultat System

CreateProperties() public méthode

Initialises this instance.
CreatePropeties is called once when the entity is constructed. Here the behaviour should create any properties required by this behaviour to function. Create properties is called before Initialise.
public CreateProperties ( System.Entity context ) : void
context System.Entity /// Initialisation context. This object can be used to publish properties to the owning entity. ///
Résultat void

GetFullPropertyName() public méthode

public GetFullPropertyName ( string propertyName ) : string
propertyName string
Résultat string

Initialise() public méthode

Initialises this instance.
Initialise/Shutdown may be called multiple times, as the instance is recycled. Here the behaviour should do any setup needed to put the behaviour into its' initial state, including getting optional properties from the entity which may have been created by other behaviours, and register to any services. Initialise is called before the behaviour is added to the manager.
public Initialise ( INamedDataProvider initialisationData ) : void
initialisationData INamedDataProvider /// Initialisation context. This object can be used to query properties and behaviours. ///
Résultat void

Initialised() protected méthode

Indicates that this instance has all been initialised
protected Initialised ( ) : void
Résultat void

Shutdown() public méthode

Shuts down this instance.
Initialise/Shutdown may be called multiple times, as the instance is recycled. Shutdown is called after the behaviour has been removed from the manager.
public Shutdown ( INamedDataProvider shutdownData ) : void
shutdownData INamedDataProvider
Résultat void