- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# Tile Class Reference

`#include <Tile.h>`

Inheritance diagram for Tile:

List of all members.

## Public Member Functions
| Tile ()
| Tile (Sprite *sprite, bool collidable, int x, int y, double depth=0)
virtual Object * | copy ()
void | collide (Object *o)
void | draw ()
void | update ()
Sprite * | getSprite ()
void | setDraw (bool draw)
bool | getDraw ()
void | calcDrawBox ()
SDL_Rect | getSquare (Sprite *sprite, double depth)
## Private Attributes
Sprite * | _sprite
bool | _draw
bool | _existDBox
SDL_Rect | _drawBox

## Detailed Description

Definition at line 7 of file Tile.h.

## Constructor & Destructor Documentation

Tile::Tile | ( |  | ) |

| Definition at line 10 of file Tile.cpp. Referenced by copy().

Tile::Tile | ( | Sprite * | sprite,
|  | bool | collidable,
|  | int | x,
|  | int | y,
|  | double | depth = `0`
| ) |

| Definition at line 15 of file Tile.cpp. References Object::_box, Object::_collidable, Object::_depth, _drawBox, Object::_id, _sprite, Object::_type, Sprite::height(), Object::id(), TILE, and Sprite::width().

## Member Function Documentation

void Tile::calcDrawBox | ( |  | ) |

| Definition at line 60 of file Tile.cpp. References Object::_box, Object::_depth, _draw, _drawBox, _existDBox, _sprite, getSquare(), Level::getTileFromPixels(), Level::instance(), Level::tileHeight, and Level::tileWidth.

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

| Reimplemented from Object. Definition at line 41 of file Tile.cpp.

Object * Tile::copy | ( |  | ) | `[virtual]`

| Reimplemented from Object. Definition at line 36 of file Tile.cpp. References Tile().

void Tile::draw | ( |  | ) | `[virtual]`

| Implements Object. Definition at line 45 of file Tile.cpp. References Object::_box, _draw, _drawBox, _existDBox, _sprite, Sprite::draw(), and Sprite::drawBox().

bool Tile::getDraw | ( |  | ) | `[inline]`

| Definition at line 21 of file Tile.h. References _draw.

Sprite* Tile::getSprite | ( |  | ) | `[inline]`

| Definition at line 19 of file Tile.h. References _sprite.

SDL_Rect Tile::getSquare | ( | Sprite * | sprite,
|  | double | depth
| ) |

| Definition at line 79 of file Tile.cpp. References Object::_box, Object::_depth, _sprite, getSquare(), Level::getTileFromPixels(), Level::instance(), Level::tileHeight, and Level::tileWidth. Referenced by calcDrawBox(), and getSquare().

void Tile::setDraw | ( | bool | draw | ) | `[inline]`

| Definition at line 20 of file Tile.h. References _draw.

void Tile::update | ( |  | ) | `[virtual]`

| Reimplemented from Object. Definition at line 55 of file Tile.cpp. References _sprite, and Sprite::update().

## Member Data Documentation

bool Tile::_draw`[private]`

| Definition at line 29 of file Tile.h. Referenced by calcDrawBox(), draw(), getDraw(), and setDraw().

SDL_Rect Tile::_drawBox`[private]`

| Definition at line 31 of file Tile.h. Referenced by calcDrawBox(), draw(), and Tile().

bool Tile::_existDBox`[private]`

| Definition at line 30 of file Tile.h. Referenced by calcDrawBox(), and draw().

Sprite* Tile::_sprite`[private]`

| Definition at line 28 of file Tile.h. Referenced by calcDrawBox(), draw(), getSprite(), getSquare(), Tile(), and update().

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

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