diff --git a/src/cell.cpp b/src/cell.cpp index 401a75d..71e1391 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -179,16 +179,13 @@ CellPtr TeleportCell::clone() const return std::make_unique(); } - /////////////////////////////////////// const std::vector TriggerCell::cells_to_cast { PASSABLE_CELL, WATER_CELL, WALL_CELL, EXIT_CELL }; -TriggerCell::TriggerCell(/*std::vector &&cells_to_change,*/ coordinate cell_row, coordinate cell_col, const sf::Color &color) : +TriggerCell::TriggerCell(coordinate cell_row, coordinate cell_col, const sf::Color &color) : Cell(cell_row, cell_col, color) { - //cells = std::move(cells_to_change); - // triggers are a bit higher than ground and water, but lower than walls height_shift = 5; } diff --git a/src/cell.h b/src/cell.h index 675bbbc..ff20efd 100644 --- a/src/cell.h +++ b/src/cell.h @@ -178,6 +178,7 @@ public: virtual ~TeleportCell() override; + /// Set the coordinates of this teleport destination void setDestination(coordinate new_cell_row, coordinate new_cell_col); virtual bool onMovingTo(HeroPtr &hero, LevelPtr &level) override; @@ -195,16 +196,16 @@ private: std::vector cells; public: - // Vector of cell types you can cast in to + /// Vector of cell types you can cast in to static const std::vector cells_to_cast; - TriggerCell(//std::vector &&cells_to_change, - coordinate cell_row = 0, + TriggerCell(coordinate cell_row = 0, coordinate cell_col = 0, const sf::Color &color = palette::Pink); virtual ~TriggerCell() override; + /// Add a cell which has to be placed to map when the trigger gets activated void addTarget(CellPtr &&cell); virtual bool onMovingTo(HeroPtr &hero, LevelPtr &level) override; diff --git a/src/level.h b/src/level.h index fec0b9e..6a3e6cf 100644 --- a/src/level.h +++ b/src/level.h @@ -45,7 +45,7 @@ private: /// Prepare prototypes of default cells void prepareDefaultCells(); - /// Map file section readers + // Map file section readers void readMapSize(std::istringstream &sstr); void readMapRow(std::istringstream &sstr); void readTeleport(std::istringstream &sstr); diff --git a/src/renderer.h b/src/renderer.h index a53726a..ba2dd78 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -18,7 +18,9 @@ private: float cell_width, cell_height, cell_deviation; unsigned int window_size; + // Reset for each iteration of window pulling float init_painter_x, init_painter_y; + float painter_x, painter_y; float vertical_shift, horizontal_shift;