#include <objects_common.h>
Inheritance diagram for Object:
Public Member Functions | |
Object (Sint16 xpos=0, Sint16 ypos=0, const ParameterMap ¶m=ParameterMap()) | |
bool | setPos (Sint16 xcord, Sint16 ycord) |
SDL_Rect | getCenter () const |
Returns the center of an object. | |
bool | isIn (const SDL_Rect &rect, bool touch=false) const |
SDL_Rect * | getPos () |
SDL_Rect | getDrawPos () const |
const Frame | getFrame () const |
string | getName () |
EmptyAnimationPtr | loadAnimation (string anim_name, double scale_factor=1, BasePointType abp_type=BP_MD, Uint16 aanimation_type=ATYPE_LOOP, double afps=0, AllignType aallign_type=AT_MD) |
Load an animation bound onto this object from an animation data file. | |
EmptyAnimationPtr | loadAnimation (const Image &abase_image, Uint16 aframes=1, BasePointType abp_type=BP_MD, Uint16 aanimation_type=ATYPE_LOOP, double afps=0, Uint16 astart_pos=0, AllignType aallign_type=AT_MD) |
Load an animation bound onto this object. | |
EmptyAnimationPtr | loadAnimation (const ParameterMap ¶m=ParameterMap()) |
Load an animation based on a parameter map. | |
bool | operator< (const Object &obj) const |
Uint16 | getType () const |
void | setType (Uint16 newtype) |
void | unsetType (Uint16 oldtype) |
void | switchType (Uint16 newtype) |
bool | updateAnim (Uint16 dt) |
bool | setAnim (EmptyAnimationPtr anim, bool start=false) |
virtual void | resetAnimState () |
Sets the animation back to the default one. | |
bool | isRunning () const |
void | mark_delete () |
Mark an object for deletion. | |
bool | isDeleted () |
virtual void | destroy () |
void | clearEvents () |
virtual void | setEvent (Event *ev) |
Uint16 | updateEvents (Uint16 dt) |
void | cancelEvent () |
Cancel the current event. | |
void | stopEvent () |
End the current event. | |
bool | getState (Uint32 cstate) const |
void | setState (Uint32 cstate) |
void | switchState (Uint32 cstate) |
void | unsetState (Uint32 cstate) |
virtual bool | act (Object *) |
virtual void | touch (Object *) |
virtual void | enter (Object *) |
virtual void | untouch (Object *) |
virtual void | leave (Object *) |
virtual void | idle (Uint16) |
Public Attributes | |
Uint32 | onum |
Static Public Attributes | |
ParameterMap | default_parameters |
Protected Attributes | |
ParameterMap | parameters |
Uint32 | state |
Event * | event |
SDL_Rect | pos |
Uint16 | otype |
string | name |
bool | delete_flag |
EmptyAnimationPtr | anim_orig |
EmptyAnimationPtr | animation |
An object has a graphical representation (animation), a position, an object type, a type and can be entered/left/touched/untouched/activated.
|
Sets the new position. If the coordinates are not in the map area they are corrected to fit into it.
|
|
Returns the center of an object.
|
|
Checks whether this object is partially inside a certain map area.
|
|
Updates the current animation
|
|
Specifies the animation to be run (usually a one time animation) and starts it right away. Should not be used with updateAnimState, set ESTATE_ANIM to deactivate an updateAnimState. This is usually controlled by an AnimationEvent |
|
Clears the event field (sets it to NULL). This should only be used by the event destructor.
|
|
Schedules a new event and cancels any currently running event
Reimplemented in Player.
|
|
Updates the event (run by the PhysicHandler) and react on the new event state (start, end or cancel an event).
|
|
Try to activate any objects in the current position
Reimplemented in Bomb, Door, Exit, Heart, Key, Teleporter, Trigger, and Item.
|
|
Touch an object, called when the object position overlaps with the position of another object for the first time. Reimplemented in Plant, and Spike.
|
|
Enter an object, called when the object center enters another object position for the first time. Reimplemented in Water, and Wind.
|
|
Untouch a touched object, called when the object no longer overlaps with another object. |
|
Leave an object, called when the object center no longer is inside another object. Reimplemented in Water, and Wind.
|
|
What should the object do all the time? This is run first of all.
Reimplemented in Character, Monster, Erik, Geyser, Plant, Scorch, TriggeredBomb, Zombie, and Player.
|
|
|