152 void addInstances(
const std::list<Instance*>& instances);
void setZoneProtected(bool protect)
Mark zone on this cell as protected.
double getCostMultiplier()
Returns the current cell cost.
Layer * m_layer
target layer
std::vector< Instance * > m_visitors
contains visitor instances
bool isNeighbor(Cell *cell)
Called to check if given cell is a neighbor.
std::vector< CellChangeListener * > m_changeListeners
change listener
bool m_difflayer
is target on another layer
void callOnInstanceEntered(Instance *instance)
Called when a instance entered this cell.
void addInstance(Instance *instance)
Adds a instance to this cell.
static const double MIN_CELL_Z
virtual void onInstanceExitedCell(Cell *cell, Instance *instance)=0
Called when some instance exited the cell.
virtual void onCellDeleted(Cell *cell)=0
Called when a cell gets deleted.
Layer * getLayer()
Returns the current layer.
double getSpeedMultiplier()
Returns the current cell speed.
virtual void onInstanceEnteredCell(Cell *cell, Instance *instance)=0
Called when some instance entered the cell.
const std::vector< Instance * > & getVisitorInstances()
Returns all visitor instances on this cell.
void callOnInstanceExited(Instance *instance)
Called when a instance exited this cell.
Listener interface for changes happening on a cell.
std::set< Instance * > m_instances
CellVisualEffect m_fowType
visual cell status
void addInstances(const std::list< Instance * > &instances)
Adds instances to this cell.
void setSpeedMultiplier(double multi)
Changes the cell speed.
void setCellType(CellTypeInfo type)
Sets blocker type.
CellType
Defines different blocker types.
Base class for all fife classes Used e.g.
virtual ~CellChangeListener()
void removeInstance(Instance *instance)
Removes a instance from this cell.
CellVisualType
Defines different cell visuals which are used for Fog of War.
int32_t getCellId()
Returns the cell identifier.
void addChangeListener(CellChangeListener *listener)
Adds new cell change listener.
bool defaultCost()
Returns if cell use default cost.
void resetCostMultiplier()
Resets the cell cost to default, 1.0.
void deleteTransition()
Removes the transistion from Cell and CellCache.
void onCellDeleted(Cell *cell)
Called when a cell gets deleted on this cell.
Listener interface for deletions happening on a cell, used for transistions.
TransitionInfo(Layer *layer)
void setZone(Zone *zone)
Sets zone.
Simple class to hold the data for transistions.
void addNeighbor(Cell *cell)
Adds a neighbor cell to this cell.
int32_t m_coordId
holds coordinate as a unique integer id
const std::set< Instance * > & getInstances()
Returns all instances on this cell.
void addVisitorInstance(Instance *instance)
Adds a instance as visitor to this cell.
bool isZoneProtected()
Returns whether the zone on this cell is protected.
CellTypeInfo getCellType()
Returns blocker type.
TransitionInfo * m_transition
Pointer to Transistion.
Layer * m_layer
parent layer
virtual void onBlockingChangedCell(Cell *cell, CellTypeInfo type, bool blocks)=0
Called when some instance changed its blocking property.
const std::vector< Cell * > & getNeighbors()
Returns the layer coordinates of this cell.
void removeDeleteListener(CellDeleteListener *listener)
Removes cell delete listener.
A basic cell on a CellCache.
void updateCellInfo()
Called to update cell data.
Cell(int32_t coordint, ModelCoordinate coordinate, Layer *layer)
Constructor.
CellVisualEffect getFoWType()
Returns the cell visual.
void changeInstance(Instance *instance)
Changes a instance on this cell.
virtual ~CellDeleteListener()
const ModelCoordinate getLayerCoordinates() const
Returns the layer coordinates of this cell.
Zone * getZone()
Returns zone.
void updateCellBlockingInfo()
void setFoWType(CellVisualEffect type)
Sets the cell visual.
void setCellId(int32_t id)
Sets the cell identifier.
void setCostMultiplier(double multi)
Changes the cell cost.
ModelCoordinate m_coordinate
holds coordinate
CellTypeInfo m_type
CellType.
void setInserted(bool inserted)
Mark cell as inserted.
void removeVisitorInstance(Instance *instance)
Removes the visitor instance from this cell.
std::vector< Cell * > m_neighbors
neighbor cells
void createTransition(Layer *layer, const ModelCoordinate &mc, bool immediate=false)
Creates a transistion from this cell to the given layer and coordinates.
void resetNeighbors()
Removes all neighbors from cell.
std::vector< CellDeleteListener * > m_deleteListeners
delete listener
bool m_inserted
already inserted
TransitionInfo * getTransition()
Returns the transition.
bool isInserted()
Returns whether the cell is part of a zone.
bool defaultSpeed()
Returns if cell use default speed.
void addDeleteListener(CellDeleteListener *listener)
Adds new cell delete listener.
void resetZone()
Resets zone.
An Instance is an "instantiation" of an Object at a Location.
bool m_immediate
use immediate
A Zone is an abstract depiction of a CellCache or of a part of it.
ModelCoordinate m_mc
target coordinates
void removeChangeListener(CellChangeListener *listener)
Removes cell change listener.
void callOnBlockingChanged(bool blocks)
Called when the blocking property of this cell changed.
void resetSpeedMultiplier()
Resets the cell speed to default, 1.0.