Annchienta::Person Class Reference

Inherits Annchienta::StaticObject.

Inherited by SwigDirector_Person.

List of all members.

Public Member Functions

virtual void collisionWithLayerAreas ()
virtual void freeze (bool value)
virtual EntityType getEntityType () const
virtual float getSpeed () const
virtual bool isFrozen () const
virtual void lookAt (StaticObject *object)
virtual bool move (int x, int y, bool force=false)
 Person (const char *name, const char *configFile)
virtual void setControl (PersonControl *personControl)
virtual void setInputControl ()
virtual void setNullControl ()
virtual void setSampleControl ()
virtual void setSpeed (float speed)
virtual void setStandAnimation (bool forceFromHeading=false)
virtual bool stepTo (Point point, bool force=true)
virtual void update ()
virtual ~Person ()

Protected Attributes

PersonControlcontrol
bool frozen
int heading
float speed

Static Protected Attributes

static const int squaredInteractDistance = 600


Detailed Description

A Person is a class derived from StaticObject, meaning it is an object in the Map. The main thing about a Person is that he is able to move.

Constructor & Destructor Documentation

Annchienta::Person::Person ( const char *  name,
const char *  configFile 
)

Create a new Person.

Parameters:
name Name for this Person.
configFile XML configuration file for the Person.

virtual Annchienta::Person::~Person (  )  [virtual]

Just another destructor.


Member Function Documentation

virtual void Annchienta::Person::collisionWithLayerAreas (  )  [virtual]

Checks if this Person collides with any Area in this Layer and executes the associated scipts if needed.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::freeze ( bool  value  )  [virtual]

Freeze or unfreeze this Person. When a Person is frozen, he will not be able to move, this can be useful in cutscenes.

Parameters:
value True to freeze, false to unfreeze.

Reimplemented from Annchienta::StaticObject.

Reimplemented in SwigDirector_Person.

virtual EntityType Annchienta::Person::getEntityType (  )  const [virtual]

Returns:
The EntityType for this Person.

Reimplemented from Annchienta::StaticObject.

Reimplemented in SwigDirector_Person.

virtual float Annchienta::Person::getSpeed (  )  const [virtual]

Returns:
The move speed for this Person.

Reimplemented in SwigDirector_Person.

virtual bool Annchienta::Person::isFrozen (  )  const [virtual]

Returns:
If thie Person is frozen, see freeze().

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::lookAt ( StaticObject object  )  [virtual]

Set the "stand{north,east,south,west}" animation, depending where the other object is.

Parameters:
object Object to look at.

Reimplemented from Annchienta::StaticObject.

Reimplemented in SwigDirector_Person.

virtual bool Annchienta::Person::move ( int  x,
int  y,
bool  force = false 
) [virtual]

Relatively move this Person. This function might not move the Person, for example when there's something in the way. To make sure the Person moves, set the force flag to true. When you set the parameter x to 1, this Person will move a distance over the x axis that is equal to getSpeed().

Parameters:
x Number of steps to move over X axis.
y Number of steps to move over Y axis.
force Ignore all obstructions and move.
Returns:
If the Person was able to move.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setControl ( PersonControl personControl  )  [virtual]

Sets a custom PersonControl inctance for this Person.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setInputControl (  )  [virtual]

Create an InputPersonControl instance for this Person and let it control this Person.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setNullControl (  )  [virtual]

Deletes the PersonControl instance associated with this Person. The Person will now halt.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setSampleControl (  )  [virtual]

Create an SamplePersonControl instance for this Person and let it control this Person.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setSpeed ( float  speed  )  [virtual]

The speed of a Person defaults to 1.0

Parameters:
speed The new move speed for this Person.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::setStandAnimation ( bool  forceFromHeading = false  )  [virtual]

Set the default standing animation for this Person.

Parameters:
forceFromHeading When set to true, the "stand{north,south,east,west}" will always be used.

Reimplemented from Annchienta::StaticObject.

Reimplemented in SwigDirector_Person.

virtual bool Annchienta::Person::stepTo ( Point  point,
bool  force = true 
) [virtual]

This function calls move() to move this Person in the direction of the given point. It does nothing when this Person is close enough to the given Point.

Parameters:
point Point to step to.
force See move().
Returns:
If the Person was able to move.

Reimplemented in SwigDirector_Person.

virtual void Annchienta::Person::update (  )  [virtual]

Update this Person.

Reimplemented from Annchienta::StaticObject.

Reimplemented in SwigDirector_Person.


Member Data Documentation

bool Annchienta::Person::frozen [protected]

int Annchienta::Person::heading [protected]

float Annchienta::Person::speed [protected]

const int Annchienta::Person::squaredInteractDistance = 600 [static, protected]


Generated on Wed Feb 4 16:31:47 2009 for Annchienta by  doxygen 1.5.7.1