 |
Cytopia
0.3
A city building simulation game
|
Go to the documentation of this file. 1 #ifndef MAPFUNCTIONS_HXX_
2 #define MAPFUNCTIONS_HXX_
35 void levelHeight(
const Point &startCoordinate,
const std::vector<Point> levelArea);
42 uint32_t index = isoCoords.
toIndex();
55 std::vector<NeighborNode>
getNeighborNodes(
const Point &isoCoordinates,
const bool includeCentralNode);
157 void newMap(
bool generateTerrain =
true);
void loadMapFromFile(const std::string &fileName)
Load Map from file.
void getNodeInformation(const Point &isoCoordinates) const
Debug MapNodeData to Console.
unsigned char getElevatedNeighborBitmask(Point centerCoordinates)
Get elevated bit mask of the map node.
std::vector< MapNode > mapNodes
int toIndex() const
calculates the index (stride) that can be used to access in Map to access mapNodes vector.
bool updateHeight(Point coordinate, const bool elevate)
Change map node height.
void demolishNode(const std::vector< Point > &isoCoordinates, bool updateNeighboringTiles=false, Layer layer=Layer::NONE)
Demolish a node.
Point getNodeOrigCornerPoint(const Point &isoCoordinates, Layer layer=Layer::NONE)
Get original corner point of given point within building borders.
void updateAllNodes()
Update all mapNodes.
@ NONE
0- this must be FIRST !!!
void updateNodeNeighbors(const std::vector< Point > &nodes)
Update the nodes and all affected node with the change.
void refreshVisibleMap()
Refresh the visible part of the map.
void highlightNode(const Point &isoCoordinates, const SpriteRGBColor &rgbColor)
Sets a node to be highlighted.
void levelHeight(const Point &startCoordinate, const std::vector< Point > levelArea)
level area of map nodes.
bool isPlacementOnNodeAllowed(const Point &isoCoordinates, const std::string &tileID) const
check if Tile is occupied
bool isPlacementOnAreaAllowed(const std::vector< Point > &targetCoordinates, const std::string &tileID) const
check if Tile can be placed in an area
std::vector< NeighborNode > getNeighborNodes(const Point &isoCoordinates, const bool includeCentralNode)
Get all neighbor nodes from provided map node.
Class that holds map nodes.
std::string getTileID(const Point &isoCoordinates, Layer layer)
get Tile ID of specific layer of specific iso coordinates
void unHighlightNode(const Point &isoCoordinates)
Sets a node to be unhighlighred.
const std::vector< MapNode > & getMapNodes()
Get all mapnodes as a vector.
void newMap(bool generateTerrain=true)
Creates a new map object with terrain gen.
Abstract Singleton implementation.
Point findNodeInMap(const SDL_Point &screenCoordinates, const Layer &layer=Layer::NONE)
Returns the node at given screen coordinates.
std::vector< uint8_t > calculateAutotileBitmask(Point coordinate)
Get a bitmask that represents same-tile neighbors.
void saveMapToFile(const std::string &fileName)
Save Map to file.
MapNode & getMapNode(Point isoCoords)
Get pointer to a single mapNode at specific iso coordinates.
bool isClickWithinTile(const SDL_Point &screenCoordinates, Point isoCoordinate, const Layer &layer) const
Check if a click is within a non transparent part of a sprite.
bool setTileID(const std::string &tileID, Point coordinate)
Set the Tile ID Of Node object.
void changeHeight(const Point &isoCoordinates, const bool elevate)
Change map node height.