|
|
|
@ -50,6 +50,7 @@ class Cell : public Entity
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
sf::Color cell_color;
|
|
|
|
|
coordinate height_shift;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Cell(coordinate cell_row = 0,
|
|
|
|
@ -60,6 +61,11 @@ public:
|
|
|
|
|
|
|
|
|
|
sf::Color color() const noexcept;
|
|
|
|
|
|
|
|
|
|
/// "shift_by_y" indicates the height of current cell
|
|
|
|
|
/// Height is a shift of y coordinate on the scene, relatively to the ground (which is 0)
|
|
|
|
|
void setHeightShift(coordinate shift_by_y);
|
|
|
|
|
coordinate heightShift() const;
|
|
|
|
|
|
|
|
|
|
/// Determine if Hero can move onto this cell or not
|
|
|
|
|
virtual bool onMovingTo(HeroPtr &hero, LevelPtr &level) = 0;
|
|
|
|
|
};
|
|
|
|
@ -67,7 +73,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// Any cell where Hero is free to move
|
|
|
|
|
class PassableCell : public Cell
|
|
|
|
|
class PassableCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PassableCell(coordinate cell_row = 0,
|
|
|
|
@ -82,7 +88,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which requires Hero to spend a charge for bridge to move on
|
|
|
|
|
class WaterCell : public Cell
|
|
|
|
|
class WaterCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WaterCell(coordinate cell_row = 0,
|
|
|
|
@ -97,7 +103,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which is impossible to move on
|
|
|
|
|
class WallCell : public Cell
|
|
|
|
|
class WallCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WallCell(coordinate cell_row = 0,
|
|
|
|
@ -112,7 +118,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which gives hero a charge
|
|
|
|
|
class ChargeCell : public Cell
|
|
|
|
|
class ChargeCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
int cell_charges;
|
|
|
|
@ -131,7 +137,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which moves hero to next level
|
|
|
|
|
class ExitCell : public Cell
|
|
|
|
|
class ExitCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ExitCell(coordinate cell_row = 0,
|
|
|
|
@ -146,7 +152,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which teleports hero to following coordinates
|
|
|
|
|
class TeleportCell : public Cell
|
|
|
|
|
class TeleportCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
coordinate new_row, new_col;
|
|
|
|
@ -168,7 +174,7 @@ public:
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/// A cell which replaces and changes other map cells when activated
|
|
|
|
|
class TriggerCell : public Cell
|
|
|
|
|
class TriggerCell final : public Cell
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
// Vector of cells to place on map
|
|
|
|
|