MCPcopy Create free account
hub / github.com/CytopiaTeam/Cytopia / decreaseHeight

Method decreaseHeight

src/engine/Map.cxx:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void Map::decreaseHeight(const Point &isoCoordinates)
90{
91 const int height = mapNodes[isoCoordinates.x * m_columns + isoCoordinates.y]->getCoordinates().height;
92
93 if (height > 0)
94 {
95 demolishNode(std::vector<Point>{isoCoordinates});
96 mapNodes[isoCoordinates.x * m_columns + isoCoordinates.y]->decreaseHeight();
97 updateNeighborsOfNode(mapNodes[isoCoordinates.x * m_columns + isoCoordinates.y]->getCoordinates());
98 mapNodes[isoCoordinates.x * m_columns + isoCoordinates.y]->getSprite()->refresh();
99 }
100}
101
102void Map::updateNeighborsOfNode(const Point &isoCoordinates)
103{

Callers 1

checkEventsMethod · 0.45

Calls 1

refreshMethod · 0.45

Tested by

no test coverage detected