Class TBehaviorList
Unit
Behaviors
Declaration
type TBehaviorList = class(TTenaciousObject)
Description
Container class for TBehaviors.
Hierarchy
TBehaviorList > TTenaciousObject > TPersistentMethods
Overview
Description
 |
constructor Create; override; |
Constructor
Copy constructor. CreateAndSet creates a copy of the supplied container object (List) by calling TBehavior.Copy for each behavior in List.
parameters
-
List
-
is the container to be copied.
 |
destructor Destroy; override; |
Destructor
 |
procedure Add(Behavior: TBehavior; MakeCopy: Boolean); |
Adds a behavior to the list (or a copy of the behavior).
parameters
-
Behavior
-
is the behavior to be added to the list.
-
MakeCopy
-
is set to
True if the list should add a copy of Behavior (calling TBehavior.Copy). In this case, the user is responsible for destroying Behavior. If set to False, the ownership of the supplied behavior (Behavior) is transferred to the list and will be destroyed upon calling the destructor Destroy.
 |
procedure AddAsStrings(Strings: TStringList); |
Adds the name of all behaviors (and any sub-behaviors) as strings to a list of strings. This procedure loops through all behaviors, calling TBehavior.AddAsStrings for each behavior.
 |
procedure Clear; |
Clears the list of behaviors by calling the destructor TBehavior.Destroy for each contained behavior and sets Count to zero.
Procedure for processing the definition of a behavior list (as parsed from the definition text file). This procedure is automatically called from TBrain.LoadFromDefinition and does not need to be called explicitly.
Properties
Overview
Description
 |
property ActiveBehaviorIndex: integer; |
Get the index of the behavior having the highest utility. Use this property together with the default property M to get the behavior with the highest utility value. It should be noted that if all behaviors have the same utility value, the first behavior index is returned (index = 1).
 |
property Count: integer; |
Number of behaviors in the container.
 |
property Level: Integer; |
Hierarchical level of the list (top level is equal to 1).
Default array property that returns a behavior based on an index number. Use this property to access any behavior contained in the list. The index (i) goes from 1 to Count.
Generated by PasDoc 0.8.8.3 on 2005-05-28 08:13:49