- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# Object Class Reference

`#include <Object.h>`

Inheritance diagram for Object:

List of all members.

## Public Member Functions
| Object ()
| Object (List *objInfo, int x, int y)
virtual SDL_Rect | getBox ()
virtual void | collide (Object *o)
virtual void | draw ()=0
virtual void | update ()
virtual std::string | id ()
virtual void | setId (std::string id)
virtual void | setPos (int x, int y)
virtual void | load (List *objInfo, bool fromConstructor=true)
virtual Object * | copy ()
virtual void | control ()
bool | collidable ()
void | setCollidable (bool b)
bool | solid ()
void | setSolid (bool b)
double | getDepth ()
void | setDepth (double depth)
CollisionType | getType ()
void | setType (CollisionType type)
std::string | getId ()
## Static Public Member Functions
static Object * | loadObject (std::string filename, int x, int y)
## Protected Attributes
SDL_Rect | _box
bool | _collidable
bool | _solid
double | _depth
std::string | _id
CollisionType | _type

## Detailed Description

Definition at line 13 of file Object.h.

## Constructor & Destructor Documentation

Object::Object | ( |  | ) |

| Definition at line 10 of file Object.cpp.

Object::Object | ( | List * | objInfo,
|  | int | x,
|  | int | y
| ) |

| Definition at line 16 of file Object.cpp. References _box, _id, List::empty(), and List::firstList().

## Member Function Documentation

bool Object::collidable | ( |  | ) | `[inline]`

| Definition at line 37 of file Object.h. References _collidable. Referenced by CollisionHandler::ObjsColliding().

virtual void Object::collide | ( | Object * | o | ) | `[inline, virtual]`

| Reimplemented in Bullet, CutScene, Door, EventPoint, Person, Player, and Tile. Definition at line 19 of file Object.h. Referenced by CollisionHandler::checkCollision().

virtual void Object::control | ( |  | ) | `[inline, virtual]`

| Reimplemented in Camera, CutScene, and Player. Definition at line 34 of file Object.h.

virtual Object* Object::copy | ( |  | ) | `[inline, virtual]`

| Reimplemented in Bullet, CutScene, Door, Enemy, EventPoint, Person, Player, and Tile. Definition at line 32 of file Object.h.

virtual void Object::draw | ( |  | ) | `[pure virtual]`

| Implemented in Bullet, Camera, CutScene, Door, EventPoint, Person, and Tile.

virtual SDL_Rect Object::getBox | ( |  | ) | `[inline, virtual]`

| Definition at line 18 of file Object.h. References _box. Referenced by Bullet::Bullet(), Person::collide(), Person::die(), ShootInRangeCommand::execute(), RunFromPlayerInRangeCommand::execute(), FollowPlayerInRangeCommand::execute(), FollowPlayerCommand::execute(), AimCommand::execute(), CollisionHandler::ObjsColliding(), Screen::recenter(), WeaponPunch::shoot(), and Screen::update().

double Object::getDepth | ( |  | ) | `[inline]`

| Definition at line 41 of file Object.h. References _depth. Referenced by Level::addObject(), and Level::registerTile().

std::string Object::getId | ( |  | ) | `[inline]`

| Definition at line 46 of file Object.h. References _id. Referenced by Weapon::shoot().

CollisionType Object::getType | ( |  | ) | `[inline]`

| Definition at line 43 of file Object.h. References _type. Referenced by Player::collide(), Person::collide(), EventPoint::collide(), Door::collide(), CutScene::collide(), Bullet::collide(), and Level::deleteObject().

virtual std::string Object::id | ( |  | ) | `[inline, virtual]`

| Definition at line 22 of file Object.h. References _id. Referenced by Level::addObject(), Level::deleteObject(), TurnCommand::getString(), ShootInRangeCommand::getString(), SetDoorLockCommand::getString(), SetControlCommand::getString(), SetCameraCommand::getString(), SecondaryShootCommand::getString(), RunFromPlayerInRangeCommand::getString(), FollowPlayerInRangeCommand::getString(), FollowPlayerCommand::getString(), CrouchCommand::getString(), AimCommand::getString(), AddWeaponCommand::getString(), AddHealthCommand::getString(), Level::levelObjectLoad(), and Tile::Tile().

virtual void Object::load | ( | List * | objInfo,
|  | bool | fromConstructor = `true`
| ) | `[inline, virtual]`

| Reimplemented in Door, Enemy, EventPoint, and Person. Definition at line 27 of file Object.h. Referenced by Person::load(), EventPoint::load(), and Door::load().

Object * Object::loadObject | ( | std::string | filename,
|  | int | x,
|  | int | y
| ) | `[static]`

| Definition at line 38 of file Object.cpp. References Parser::parse(), and List::rest(). Referenced by Person::die(), and Level::levelObjectLoad().

void Object::setCollidable | ( | bool | b | ) | `[inline]`

| Definition at line 38 of file Object.h. References _collidable. Referenced by Level::levelTextureLoad().

void Object::setDepth | ( | double | depth | ) | `[inline]`

| Definition at line 42 of file Object.h. References _depth. Referenced by Level::levelTextureLoad().

virtual void Object::setId | ( | std::string | id | ) | `[inline, virtual]`

| Definition at line 23 of file Object.h. References _id.

virtual void Object::setPos | ( | int | x,
|  | int | y
| ) | `[inline, virtual]`

| Reimplemented in Person. Definition at line 25 of file Object.h. References _box. Referenced by Person::die(), SetPositionCommand::execute(), and Person::setPos().

void Object::setSolid | ( | bool | b | ) | `[inline]`

| Definition at line 40 of file Object.h. References _solid.

void Object::setType | ( | CollisionType | type | ) | `[inline]`

| Definition at line 44 of file Object.h. References _type.

bool Object::solid | ( |  | ) | `[inline]`

| Definition at line 39 of file Object.h. References _solid. Referenced by CollisionHandler::checkCollision().

virtual void Object::update | ( |  | ) | `[inline, virtual]`

| Reimplemented in Bullet, CutScene, Door, Enemy, EventPoint, Person, Player, and Tile. Definition at line 21 of file Object.h.

## Member Data Documentation

SDL_Rect Object::_box`[protected]`

| Definition at line 46 of file Object.h. Referenced by Bullet::Bullet(), Tile::calcDrawBox(), Person::collide(), Person::crouch(), Person::die(), Tile::draw(), Person::draw(), EventPoint::draw(), Door::draw(), Bullet::draw(), getBox(), Tile::getSquare(), Person::load(), Object(), Person::Person(), Door::setOpen(), setPos(), Tile::Tile(), Person::touchingAbove(), Person::touchingBelow(), Person::touchingLeft(), Person::touchingRight(), Person::uncrouch(), Person::update(), and Bullet::update().

bool Object::_collidable`[protected]`

| Definition at line 50 of file Object.h. Referenced by collidable(), Door::collide(), Person::die(), EventPoint::EventPoint(), Person::Person(), setCollidable(), Door::setOpen(), and Tile::Tile().

double Object::_depth`[protected]`

| Definition at line 52 of file Object.h. Referenced by Bullet::Bullet(), Tile::calcDrawBox(), Enemy::Enemy(), getDepth(), Tile::getSquare(), Player::Player(), setDepth(), and Tile::Tile().

std::string Object::_id`[protected]`

| Definition at line 54 of file Object.h. Referenced by getId(), id(), Object(), CutScene::runScene(), setId(), and Tile::Tile().

bool Object::_solid`[protected]`

| Definition at line 51 of file Object.h. Referenced by Bullet::Bullet(), CutScene::CutScene(), EventPoint::EventPoint(), setSolid(), and solid().

CollisionType Object::_type`[protected]`

| Definition at line 55 of file Object.h. Referenced by Person::addHealth(), Bullet::Bullet(), Camera::Camera(), Person::collide(), CutScene::CutScene(), Door::Door(), Enemy::Enemy(), EventPoint::EventPoint(), getType(), Player::Player(), setType(), and Tile::Tile().

The documentation for this class was generated from the following files:

- C:/Documents and Settings/jegan/Desktop/projectX/Object.h
- C:/Documents and Settings/jegan/Desktop/projectX/Object.cpp