2020-11-27 13:10:09 +00:00
|
|
|
#ifndef PACMAN_BOARD_H
|
|
|
|
#define PACMAN_BOARD_H
|
|
|
|
|
2020-11-28 13:10:25 +00:00
|
|
|
#include "Direction.hpp"
|
|
|
|
#include "Position.hpp"
|
|
|
|
|
2020-11-27 13:10:09 +00:00
|
|
|
#include <SDL2/SDL_rect.h>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
const uint8_t ROWS = 31;
|
|
|
|
const uint8_t COLUMNS = 28;
|
|
|
|
|
|
|
|
class Board {
|
|
|
|
public:
|
|
|
|
Board();
|
|
|
|
|
|
|
|
[[nodiscard]] bool isWalkable(Position point, float_t d, Direction direction) const;
|
|
|
|
|
2020-11-28 13:10:25 +00:00
|
|
|
[[nodiscard]] std::vector<SDL_Point> initialPelletPositions() const;
|
2020-11-27 13:10:09 +00:00
|
|
|
|
2020-11-28 13:10:25 +00:00
|
|
|
[[nodiscard]] std::vector<SDL_Point> initialSuperPelletPositions() const;
|
2020-11-27 13:10:09 +00:00
|
|
|
|
2020-11-28 13:10:25 +00:00
|
|
|
static Position initialPacManPosition() { return {14, 23}; }
|
2020-11-27 13:10:09 +00:00
|
|
|
|
|
|
|
private:
|
2020-11-27 16:16:42 +00:00
|
|
|
uint8_t board_state[ROWS][COLUMNS]{};
|
2020-11-27 13:10:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //PACMAN_BOARD_H
|