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) |
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 () |
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 91 of file layer.cpp.
References FIFE::Instance::isActive(), and FIFE::Instance::setLocation().
bool FIFE::Layer::areInstancesVisible | ( | ) | const [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 70 of file layer.cpp.
References FIFE::Instance::isActive().
void FIFE::Layer::deleteInstance | ( | Instance * | object | ) |
CellGrid* FIFE::Layer::getCellGrid | ( | ) | const [inline] |
Get the Cellgrid
Definition at line 120 of file layer.h.
Referenced by FIFE::Camera::getCellImageDimensions(), and FIFE::CellSelectionRenderer::render().
std::vector<Instance*>& FIFE::Layer::getChangedInstances | ( | ) | [inline] |
const std::string& FIFE::Layer::getId | ( | ) | const [inline] |
Instance * FIFE::Layer::getInstance | ( | const std::string & | identifier | ) |
const std::vector<Instance*>& FIFE::Layer::getInstances | ( | ) | const [inline] |
std::vector< Instance * > FIFE::Layer::getInstances | ( | const std::string & | id | ) |
std::vector< Instance * > FIFE::Layer::getInstancesAt | ( | Location & | loc, |
bool | use_exactcoordinates = false |
||
) |
InstanceTree* FIFE::Layer::getInstanceTree | ( | void | ) | const [inline] |
uint8_t FIFE::Layer::getLayerTransparency | ( | ) |
Map* FIFE::Layer::getMap | ( | ) | const [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. |
PathingStrategy FIFE::Layer::getPathingStrategy | ( | ) | const [inline] |
Gets pathing strategy for the layer
bool FIFE::Layer::hasInstances | ( | ) | const |
bool FIFE::Layer::isChanged | ( | ) | [inline] |
void FIFE::Layer::removeChangeListener | ( | LayerChangeListener * | listener | ) |
void FIFE::Layer::setCellGrid | ( | CellGrid * | grid | ) | [inline] |
void FIFE::Layer::setId | ( | const std::string & | id | ) | [inline] |
void FIFE::Layer::setInstancesVisible | ( | bool | vis | ) |
void FIFE::Layer::setLayerTransparency | ( | uint8_t | transparency | ) |
void FIFE::Layer::setPathingStrategy | ( | PathingStrategy | strategy | ) | [inline] |
Sets pathing strategy for the layer
void FIFE::Layer::toggleInstancesVisible | ( | ) |
bool FIFE::Layer::update | ( | ) |