pacman/lib/Board.hpp

28 lines
576 B
C++
Raw Normal View History

2021-06-10 12:42:51 +00:00
#pragma once
2020-11-27 13:10:09 +00:00
#include <SFML/Graphics.hpp>
#include "Direction.hpp"
#include "Position.hpp"
2020-11-27 13:10:09 +00:00
#include <cstdint>
#include <vector>
const uint8_t ROWS = 31;
const uint8_t COLUMNS = 28;
class Board {
public:
Board();
2021-05-10 13:14:38 +00:00
[[nodiscard]] bool isWalkable(Position point, float d, Direction direction) const;
2020-11-27 13:10:09 +00:00
[[nodiscard]] std::vector<PositionInt> initialPelletPositions() const;
2020-11-27 13:10:09 +00:00
[[nodiscard]] std::vector<PositionInt> initialSuperPelletPositions() const;
2020-11-27 13:10:09 +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
};