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.

Exibir arquivo Open project: martindevans/Myre Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method 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.

Protected Methods

Method Description
Behaviour ( ) : System
Behaviour ( string name ) : System
Initialised ( ) : void

Indicates that this instance has all been initialised

Method Details

Behaviour() protected method

protected Behaviour ( ) : System
return System

Behaviour() protected method

protected Behaviour ( string name ) : System
name string
return System

CreateProperties() public method

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. ///
return void

GetFullPropertyName() public method

public GetFullPropertyName ( string propertyName ) : string
propertyName string
return string

Initialise() public method

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. ///
return void

Initialised() protected method

Indicates that this instance has all been initialised
protected Initialised ( ) : void
return void

Shutdown() public method

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
return void