Remove nodiscard
This commit is contained in:
parent
d3cc1d90c7
commit
76c931656f
8 changed files with 27 additions and 26 deletions
|
@ -23,7 +23,7 @@ GridPosition PacManAnimation::animationFrame(Direction direction) const {
|
|||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] GridPosition PacManAnimation::deathAnimationFrame() const {
|
||||
GridPosition PacManAnimation::deathAnimationFrame() const {
|
||||
return GridPosition{ animation_position, 1 };
|
||||
}
|
||||
|
||||
|
|
|
@ -10,17 +10,18 @@
|
|||
|
||||
namespace pacman {
|
||||
|
||||
[[nodiscard]] bool isWalkableForPacMan(GridPosition point);
|
||||
[[nodiscard]] bool isWalkableForGhost(GridPosition point, GridPosition origin, bool isEyes);
|
||||
[[nodiscard]] bool isInPen(GridPosition point);
|
||||
[[nodiscard]] bool isPortal(GridPosition point, Direction direction);
|
||||
[[nodiscard]] GridPosition teleport(GridPosition point);
|
||||
bool isWalkableForPacMan(GridPosition point);
|
||||
bool isWalkableForGhost(GridPosition point, GridPosition origin, bool isEyes);
|
||||
bool isInPen(GridPosition point);
|
||||
bool isPortal(GridPosition point, Direction direction);
|
||||
GridPosition teleport(GridPosition point);
|
||||
|
||||
[[nodiscard]] std::vector<GridPosition> initialPelletPositions();
|
||||
std::vector<GridPosition> initialPelletPositions();
|
||||
|
||||
[[nodiscard]] std::vector<GridPosition> initialSuperPelletPositions();
|
||||
std::vector<GridPosition> initialSuperPelletPositions();
|
||||
|
||||
inline Position penDoorPosition() { return { 13, 11 }; }
|
||||
inline Position penDoorPosition() {
|
||||
return { 13, 11 }; }
|
||||
inline Position initialPacManPosition() { return { 13.5, 23 }; }
|
||||
|
||||
} // namespace pacman
|
||||
|
|
|
@ -22,17 +22,17 @@ public:
|
|||
explicit Ghost(Atlas::Ghost spriteSet);
|
||||
virtual ~Ghost() = default;
|
||||
|
||||
[[nodiscard]] GridPosition currentSprite() const;
|
||||
GridPosition currentSprite() const;
|
||||
|
||||
[[nodiscard]] Position position() const;
|
||||
Position position() const;
|
||||
|
||||
[[nodiscard]] GridPosition positionInGrid() const;
|
||||
GridPosition positionInGrid() const;
|
||||
|
||||
void update(std::chrono::milliseconds time_delta, const GameState & gameState);
|
||||
void frighten();
|
||||
void die();
|
||||
[[nodiscard]] bool isFrightened() const;
|
||||
[[nodiscard]] bool isEyes() const;
|
||||
bool isFrightened() const;
|
||||
bool isEyes() const;
|
||||
void reset();
|
||||
|
||||
private:
|
||||
|
@ -56,7 +56,7 @@ protected:
|
|||
std::chrono::milliseconds timeChase = {};
|
||||
Position pos;
|
||||
GridPosition last_grid_position = { 0, 0 };
|
||||
[[nodiscard]] bool isInPen() const;
|
||||
bool isInPen() const;
|
||||
};
|
||||
|
||||
} // namespace pacman
|
||||
|
|
|
@ -10,7 +10,7 @@ public:
|
|||
bool left = false;
|
||||
bool right = false;
|
||||
|
||||
[[nodiscard]] Direction direction() const {
|
||||
Direction direction() const {
|
||||
if (left)
|
||||
return Direction::LEFT;
|
||||
else if (right)
|
||||
|
|
|
@ -13,17 +13,17 @@ class InputState;
|
|||
|
||||
class PacMan {
|
||||
public:
|
||||
[[nodiscard]] GridPosition currentSprite() const;
|
||||
GridPosition currentSprite() const;
|
||||
|
||||
[[nodiscard]] Position position() const;
|
||||
Position position() const;
|
||||
|
||||
[[nodiscard]] GridPosition positionInGrid() const;
|
||||
GridPosition positionInGrid() const;
|
||||
|
||||
void update(std::chrono::milliseconds time_delta, Direction input_direction);
|
||||
|
||||
void die();
|
||||
void reset();
|
||||
[[nodiscard]] bool hasDirection() const {
|
||||
bool hasDirection() const {
|
||||
return direction != Direction::NONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ namespace pacman {
|
|||
|
||||
class PacManAnimation {
|
||||
public:
|
||||
[[nodiscard]] GridPosition animationFrame(Direction direction) const;
|
||||
[[nodiscard]] GridPosition deathAnimationFrame() const;
|
||||
GridPosition animationFrame(Direction direction) const;
|
||||
GridPosition deathAnimationFrame() const;
|
||||
|
||||
void updateAnimationPosition(std::chrono::milliseconds time_delta, bool dead);
|
||||
void pause();
|
||||
|
|
|
@ -9,11 +9,11 @@ class Pellets {
|
|||
public:
|
||||
explicit Pellets();
|
||||
|
||||
[[nodiscard]] GridPosition currentSprite() const {
|
||||
GridPosition currentSprite() const {
|
||||
return sprite;
|
||||
};
|
||||
|
||||
[[nodiscard]] std::vector<GridPosition> currentPositions() const {
|
||||
std::vector<GridPosition> currentPositions() const {
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@ class SuperPellets {
|
|||
public:
|
||||
explicit SuperPellets();
|
||||
|
||||
[[nodiscard]] GridPosition currentSprite() const {
|
||||
GridPosition currentSprite() const {
|
||||
return sprite;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<GridPosition> currentPositions() const {
|
||||
std::vector<GridPosition> currentPositions() const {
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue