hoa_map::private_map::MapZone Class Reference

A class that represents a special zone on a map. More...

#include <map_zones.h>

Inheritance diagram for hoa_map::private_map::MapZone:

Inheritance graph
[legend]
Collaboration diagram for hoa_map::private_map::MapZone:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void AddSection (ZoneSection *section)
bool IsInsideZone (uint16 pos_x, uint16 pos_y)
 Returns true if the position coordinates are located inside the zone.
 MapZone ()
virtual void Update ()
 Updates the state of the zone and the state of any objects in the zone.
virtual ~MapZone ()

Protected Member Functions

void _RandomPosition (uint16 &x, uint16 &y)
 Returns random x, y position coordinates within the zone.

Protected Attributes

std::vector< ZoneSection_sections
 The rectangular sections which compose the map zone.

Detailed Description

A class that represents a special zone on a map.

***************************************************************************

The area is made up of many ZoneSection instances, so it can be any shape. This class can be derived to create enemy zones, poisonous zones, etc.

Note:
ZoneSections in the MapZone may overlap without any problem.

Definition at line 58 of file map_zones.h.


Constructor & Destructor Documentation

hoa_map::private_map::MapZone::MapZone (  )  [inline]

Definition at line 60 of file map_zones.h.

virtual hoa_map::private_map::MapZone::~MapZone (  )  [inline, virtual]

Definition at line 63 of file map_zones.h.


Member Function Documentation

void hoa_map::private_map::MapZone::_RandomPosition ( uint16 x,
uint16 y 
) [protected]

Returns random x, y position coordinates within the zone.

Parameters:
&x A reference where to store the value of the x position
&y A reference where to store the value of the x position

Definition at line 57 of file map_zones.cpp.

References _sections, and hoa_utils::RandomBoundedInteger().

Referenced by hoa_map::private_map::EnemyZone::Update().

Here is the call graph for this function:

void hoa_map::private_map::MapZone::AddSection ( ZoneSection section  ) 

Definition at line 36 of file map_zones.cpp.

References _sections.

bool hoa_map::private_map::MapZone::IsInsideZone ( uint16  pos_x,
uint16  pos_y 
)

Returns true if the position coordinates are located inside the zone.

Parameters:
pos_x The x position to check
pos_y The y position to check

Definition at line 43 of file map_zones.cpp.

References _sections.

Referenced by hoa_map::private_map::EnemySprite::Update().

virtual void hoa_map::private_map::MapZone::Update (  )  [inline, virtual]

Updates the state of the zone and the state of any objects in the zone.

Reimplemented in hoa_map::private_map::EnemyZone.

Definition at line 76 of file map_zones.h.


Member Data Documentation

std::vector<ZoneSection> hoa_map::private_map::MapZone::_sections [protected]

The rectangular sections which compose the map zone.

Definition at line 81 of file map_zones.h.

Referenced by _RandomPosition(), AddSection(), and IsInsideZone().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:14:56 2007 for Hero of Allacrost by  doxygen 1.5.1