FIFE
2008.0
|
#include <layer.h>
Public Member Functions | |
Layer (const std::string &identifier, Map *map, CellGrid *grid) | |
~Layer () | |
const std::string & | getId () const |
void | setId (const std::string &id) |
Map * | getMap () const |
CellGrid * | getCellGrid () const |
void | setCellGrid (CellGrid *grid) |
InstanceTree * | getInstanceTree (void) const |
bool | hasInstances () const |
Instance * | createInstance (Object *object, const ModelCoordinate &p, const std::string &id="") |
Instance * | createInstance (Object *object, const ExactModelCoordinate &p, const std::string &id="") |
bool | addInstance (Instance *instance, const ExactModelCoordinate &p) |
void | deleteInstance (Instance *object) |
const std::vector< Instance * > & | getInstances () const |
std::vector< Instance * > | getInstances (const std::string &id) |
std::vector< Instance * > | getInstancesAt (Location &loc, bool use_exactcoordinates=false) |
std::list< Instance * > | getInstancesIn (Rect &rec) |
Instance * | getInstance (const std::string &identifier) |
void | setInstancesVisible (bool vis) |
void | setLayerTransparency (uint8_t transparency) |
uint8_t | getLayerTransparency () |
void | getMinMaxCoordinates (ModelCoordinate &min, ModelCoordinate &max, const Layer *layer=0) const |
bool | cellContainsBlockingInstance (const ModelCoordinate &cellCoordinate) |
void | toggleInstancesVisible () |
bool | areInstancesVisible () const |
bool | update () |
void | setPathingStrategy (PathingStrategy strategy) |
PathingStrategy | getPathingStrategy () const |
void | addChangeListener (LayerChangeListener *listener) |
void | removeChangeListener (LayerChangeListener *listener) |
bool | isChanged () |
std::vector< Instance * > & | getChangedInstances () |
![]() | |
fifeid_t | getFifeId () |
FIFE::Layer::Layer | ( | const std::string & | identifier, |
Map * | map, | ||
CellGrid * | grid | ||
) |
void FIFE::Layer::addChangeListener | ( | LayerChangeListener * | listener | ) |
bool FIFE::Layer::addInstance | ( | Instance * | instance, |
const ExactModelCoordinate & | p | ||
) |
Add a valid instance at a specific position. This is temporary. It will be moved to a higher level
later so that we can ensure that each Instance only lives in one layer.
Definition at line 90 of file layer.cpp.
References FIFE::Instance::isActive(), and FIFE::Instance::setLocation().
|
inline |
bool FIFE::Layer::cellContainsBlockingInstance | ( | const ModelCoordinate & | cellCoordinate | ) |
Instance * FIFE::Layer::createInstance | ( | Object * | object, |
const ModelCoordinate & | p, | ||
const std::string & | id = "" |
||
) |
Instance * FIFE::Layer::createInstance | ( | Object * | object, |
const ExactModelCoordinate & | p, | ||
const std::string & | id = "" |
||
) |
Add an instance of an object at a specific position
Definition at line 69 of file layer.cpp.
References FIFE::Instance::isActive().
void FIFE::Layer::deleteInstance | ( | Instance * | object | ) |
|
inline |
Get the Cellgrid
Definition at line 121 of file layer.h.
Referenced by FIFE::Camera::getCellImageDimensions(), FIFE::Camera::getZOffset(), and FIFE::CellSelectionRenderer::render().
|
inline |
|
inline |
Instance * FIFE::Layer::getInstance | ( | const std::string & | identifier | ) |
|
inline |
std::vector< Instance * > FIFE::Layer::getInstances | ( | const std::string & | id | ) |
std::vector< Instance * > FIFE::Layer::getInstancesAt | ( | Location & | loc, |
bool | use_exactcoordinates = false |
||
) |
Returns instances that match given rect.
rec | rect where to fetch instances from |
Definition at line 182 of file layer.cpp.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
|
inline |
uint8_t FIFE::Layer::getLayerTransparency | ( | ) |
|
inline |
void FIFE::Layer::getMinMaxCoordinates | ( | ModelCoordinate & | min, |
ModelCoordinate & | max, | ||
const Layer * | layer = 0 |
||
) | const |
Retrieves the minimum/maximum coordinates of instances on the layer.
min | A reference to a ModelCoordinate that will hold the minimum coordinate. |
max | A reference to a ModelCoordinate that will hold the maximum coordinate. |
layer | A pointer to another layer that can be used to cast coordinates bettween layers. |
|
inline |
bool FIFE::Layer::hasInstances | ( | ) | const |
|
inline |
void FIFE::Layer::removeChangeListener | ( | LayerChangeListener * | listener | ) |
|
inline |
|
inline |
void FIFE::Layer::setInstancesVisible | ( | bool | vis | ) |
void FIFE::Layer::setLayerTransparency | ( | uint8_t | transparency | ) |
|
inline |
void FIFE::Layer::toggleInstancesVisible | ( | ) |
bool FIFE::Layer::update | ( | ) |