Intro    Entity    Trait    Action

Trait structure  - "LifeAI_Trait.h"

    Constructor
        Trait

    Static
        getCount
        getTrait (by number)
        getTrait (by name)

    General
        setName
        getName


Constructor


LifeAI::Trait( std::string name = LAI_DEF_TRAIT_NAME )

When creating a trait, can specify optionally store a name string for the trait.


Static


static int LifeAI::Trait::getCount()

Returns the total number of traits that have been created.  Can be useful if you need to iterate through all traits with getTrait()


static Trait* LifeAI::Trait::getTrait( int number )

Returns a trait address, according to the number you specify in the parameter.  The "number" refers to the order of the trait in the main trait list.  For example, if you need to reference the first trait created, the "number" should be 0.  For the second trait, the "number" should be 1.  Can be useful if you need to iterate through all traits.


static Trait* LifeAI::Trait::getTrait( std::string name )

Returns a trait address, according to the string you specify in the "name" parameter.  Looks through the main trait list and returns the first trait that has that name.


General


void setName( std::string name )

Specify a optional name string for a trait.  can be useful if you need to output trait names in a program.  For example:
    energy.setName("energy");


std::string getName()


Returns the name string stored for the Trait.