Annchienta::Area Class Reference

List of all members.

Public Member Functions

 Area (Point p1, Point p2, bool visible=false)
bool hasPoint (Point point)
bool hasTile (Tile *tile)
bool isVisible () const
void onCollision ()
void setOnCollisionCode (const char *code)
void setOnCollisionScript (const char *filename)
void setVisible (bool visible)
 ~Area ()

Private Attributes

Point mp1
Point mp2
Point mp3
Point mp4
char * onCollisionCode
char * onCollisionScript
Point p1
Point p2
bool visible


Detailed Description

An area is a rectangular field on a map. It is used to trigger code when the player walks into one of these areas, thus adding interactivity to maps.

Constructor & Destructor Documentation

Annchienta::Area::Area ( Point  p1,
Point  p2,
bool  visible = false 
)

Create a new area.

Parameters:
p1 The upper left corner of the area.
p2 The bottom right corner of the area.
visible If the Area should be visible.

Annchienta::Area::~Area (  ) 


Member Function Documentation

bool Annchienta::Area::hasPoint ( Point  point  ) 

Checks if the given Point lies in this area.

bool Annchienta::Area::hasTile ( Tile tile  ) 

Checks if the given Tile lies in this area. (Entirely)

bool Annchienta::Area::isVisible (  )  const

Returns:
If the Area is visible.

void Annchienta::Area::onCollision (  ) 

Trigger collision. This is done by the MapManager, but can also be emulated manually.

void Annchienta::Area::setOnCollisionCode ( const char *  code  ) 

Sets the code to be executed on collision with the player.

Parameters:
code The code you want to be executed.

void Annchienta::Area::setOnCollisionScript ( const char *  filename  ) 

Sets the script to be executed on collision with the player.

Parameters:
filename Filename of the script you want to be executed.

void Annchienta::Area::setVisible ( bool  visible  ) 

If the Area is visible, a visual indication will be drawn over it.

Parameters:
visible If the Area should be visible.


Member Data Documentation

bool Annchienta::Area::visible [private]


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