ManaPlus
|
#include <speciallayer.h>
Public Member Functions | |
SpecialLayer (const std::string &name, const int width, const int height) | |
~SpecialLayer () | |
void | draw (Graphics *const graphics, int startX, int startY, int endX, int endY, const int scrollX, const int scrollY) const |
MapItem * | getTile (const int x, const int y) const |
void | setTile (const int x, const int y, MapItem *const item) |
void | setTile (const int x, const int y, const int type) |
void | addRoad (const Path &road) |
void | clean () |
int | calcMemoryLocal () const |
std::string | getCounterName () const |
void | updateCache () |
Public Member Functions inherited from MemoryCounter | |
MemoryCounter () | |
virtual | ~MemoryCounter () |
int | calcMemory (const int level) const |
virtual int | calcMemoryChilds (const int level) const |
Private Attributes | |
const std::string | mName |
MapItem ** | mTiles |
int * | mCache |
int | mWidth |
int | mHeight |
Friends | |
class | Map |
class | MapLayer |
Definition at line 34 of file speciallayer.h.
SpecialLayer::SpecialLayer | ( | const std::string & | name, |
const int | width, | ||
const int | height | ||
) |
Definition at line 35 of file speciallayer.cpp.
References mCache, mHeight, mTiles, and mWidth.
Referenced by calcMemoryLocal().
SpecialLayer::~SpecialLayer | ( | ) |
void SpecialLayer::addRoad | ( | const Path & | road | ) |
Definition at line 104 of file speciallayer.cpp.
References FOR_EACH, getTile(), MapItemType::ROAD, setTile(), MapItem::setType(), updateCache(), Position::x, and Position::y.
Referenced by LocalPlayer::navigateTo(), and LocalPlayer::updateCoords().
|
virtual |
Reimplemented from MemoryCounter.
Definition at line 163 of file speciallayer.cpp.
References mHeight, mWidth, and SpecialLayer().
void SpecialLayer::clean | ( | ) |
Definition at line 118 of file speciallayer.cpp.
References MapItemType::EMPTY, mHeight, mTiles, mWidth, MapItem::setType(), and updateCache().
Referenced by LocalPlayer::navigateClean(), and LocalPlayer::updateCoords().
void SpecialLayer::draw | ( | Graphics *const | graphics, |
int | startX, | ||
int | startY, | ||
int | endX, | ||
int | endY, | ||
const int | scrollX, | ||
const int | scrollY | ||
) | const |
Definition at line 132 of file speciallayer.cpp.
References BLOCK_END, BLOCK_START, MapItem::draw(), mapTileSize, mHeight, mTiles, mWidth, x, and y.
|
inlinevirtual |
MapItem * SpecialLayer::getTile | ( | const int | x, |
const int | y | ||
) | const |
Definition at line 57 of file speciallayer.cpp.
References mHeight, mTiles, mWidth, x, and y.
Referenced by RenameListener::action(), addRoad(), Map::saveExtraLayer(), LocalPlayer::setHome(), LocalPlayer::setRealPos(), and SocialNavigationTab::updateList().
void SpecialLayer::setTile | ( | const int | x, |
const int | y, | ||
const int | type | ||
) |
Definition at line 82 of file speciallayer.cpp.
References mHeight, mTiles, mWidth, MapItem::setPos(), MapItem::setType(), x, and y.
void SpecialLayer::setTile | ( | const int | x, |
const int | y, | ||
MapItem *const | item | ||
) |
Definition at line 67 of file speciallayer.cpp.
References mHeight, mTiles, mWidth, MapItem::setPos(), x, and y.
Referenced by addRoad(), PopupMenu::handleLink(), LocalPlayer::setHome(), and LocalPlayer::setRealPos().
void SpecialLayer::updateCache | ( | ) |
Definition at line 169 of file speciallayer.cpp.
References MapItemType::EMPTY, mCache, mHeight, mTiles, MapItem::mType, mWidth, x, and y.
Referenced by addRoad(), clean(), PopupMenu::handleLink(), LocalPlayer::setHome(), and LocalPlayer::setRealPos().
|
friend |
Definition at line 37 of file speciallayer.h.
|
friend |
Definition at line 38 of file speciallayer.h.
|
private |
Definition at line 81 of file speciallayer.h.
Referenced by SpecialLayer(), updateCache(), and ~SpecialLayer().
|
private |
Definition at line 83 of file speciallayer.h.
Referenced by calcMemoryLocal(), clean(), draw(), getTile(), Map::saveExtraLayer(), setTile(), SpecialLayer(), updateCache(), and ~SpecialLayer().
|
private |
Definition at line 79 of file speciallayer.h.
Referenced by getCounterName().
|
private |
Definition at line 80 of file speciallayer.h.
Referenced by clean(), draw(), getTile(), setTile(), SpecialLayer(), updateCache(), and ~SpecialLayer().
|
private |
Definition at line 82 of file speciallayer.h.
Referenced by calcMemoryLocal(), clean(), draw(), getTile(), Map::saveExtraLayer(), setTile(), SpecialLayer(), updateCache(), and ~SpecialLayer().