hoa_map::private_map::PhysicalObject Class Reference

Represents visible objects on the map that have no motion. More...

#include <map_objects.h>

Inheritance diagram for hoa_map::private_map::PhysicalObject:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Draw ()
 Draws the object to the screen, if it is visible.
 PhysicalObject ()
void Update ()
 Updates the object's animation frames if it is animated.
 ~PhysicalObject ()
Lua Access Functions
These functions are specifically written for Lua binding, to enable Lua to access the members of this class.

void AddAnimation (hoa_video::AnimatedImage new_img)
uint8 GetCurrentAnimation () const
void SetAnimationProgress (uint32 progress)
void SetCurrentAnimation (uint8 current)

Public Attributes

std::vector< hoa_video::AnimatedImageanimations
 A vector containing all the object's animations. Note that these need not be actual animations. An AnimatedImage object may consist of only a single frame. Usually an object will only need a single image or animation, but a vector is used here in case others are needed.
uint8 current_animation
 The index to the animations vector that contains the current image to display.

Detailed Description

Represents visible objects on the map that have no motion.

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

This class represents both still image and animated objects. These objects are fixed in place and can not move. The object must have at least one entry in its image vector, otherwise a segmentation fault will occur if the Update or Draw functions are called.

Note:
If the object does not have any animated images, set the updatable member of this class to false. Forgetting to do this will do no harm, but it will do an extra function call that it shouldn't need to do.

Definition at line 301 of file map_objects.h.


Constructor & Destructor Documentation

hoa_map::private_map::PhysicalObject::PhysicalObject (  ) 

Definition at line 91 of file map_objects.cpp.

References hoa_map::private_map::MapObject::_object_type, and hoa_map::private_map::PHYSICAL_TYPE.

hoa_map::private_map::PhysicalObject::~PhysicalObject (  ) 

Definition at line 99 of file map_objects.cpp.

References animations.


Member Function Documentation

void hoa_map::private_map::PhysicalObject::AddAnimation ( hoa_video::AnimatedImage  new_img  )  [inline]

Definition at line 328 of file map_objects.h.

References animations.

void hoa_map::private_map::PhysicalObject::Draw (  )  [virtual]

Draws the object to the screen, if it is visible.

Implements hoa_map::private_map::MapObject.

Definition at line 112 of file map_objects.cpp.

References animations, current_animation, hoa_map::private_map::MapObject::DrawHelper(), hoa_video::GameVideo::DrawImage(), and hoa_video::VideoManager.

Here is the call graph for this function:

uint8 hoa_map::private_map::PhysicalObject::GetCurrentAnimation (  )  const [inline]

Definition at line 337 of file map_objects.h.

References current_animation.

void hoa_map::private_map::PhysicalObject::SetAnimationProgress ( uint32  progress  )  [inline]

Definition at line 334 of file map_objects.h.

References animations, and current_animation.

void hoa_map::private_map::PhysicalObject::SetCurrentAnimation ( uint8  current  )  [inline]

Definition at line 331 of file map_objects.h.

References animations, and current_animation.

void hoa_map::private_map::PhysicalObject::Update (  )  [virtual]

Updates the object's animation frames if it is animated.

Implements hoa_map::private_map::MapObject.

Definition at line 105 of file map_objects.cpp.

References animations, current_animation, and hoa_map::private_map::MapObject::updatable.


Member Data Documentation

std::vector<hoa_video::AnimatedImage> hoa_map::private_map::PhysicalObject::animations

A vector containing all the object's animations. Note that these need not be actual animations. An AnimatedImage object may consist of only a single frame. Usually an object will only need a single image or animation, but a vector is used here in case others are needed.

Definition at line 311 of file map_objects.h.

Referenced by AddAnimation(), Draw(), SetAnimationProgress(), SetCurrentAnimation(), Update(), and ~PhysicalObject().

uint8 hoa_map::private_map::PhysicalObject::current_animation

The index to the animations vector that contains the current image to display.

Definition at line 304 of file map_objects.h.

Referenced by Draw(), GetCurrentAnimation(), SetAnimationProgress(), SetCurrentAnimation(), and Update().


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