pacman/lib/Board.hpp
Corentin Jabot c7ef086d3d Migrate from SDL to SFML
This simplifies the rendering code and remove all(!) pointers.

There is a number of unresolved issues

* Windows build ?
* position delta computation: migrating to SFML seems to have modified
the frame rate.
2021-06-22 13:17:12 +02:00

27 lines
576 B
C++

#pragma once
#include <SFML/Graphics.hpp>
#include "Direction.hpp"
#include "Position.hpp"
#include <cstdint>
#include <vector>
const uint8_t ROWS = 31;
const uint8_t COLUMNS = 28;
class Board {
public:
Board();
[[nodiscard]] bool isWalkable(Position point, float d, Direction direction) const;
[[nodiscard]] std::vector<PositionInt> initialPelletPositions() const;
[[nodiscard]] std::vector<PositionInt> initialSuperPelletPositions() const;
static Position initialPacManPosition() { return { 14, 23 }; }
private:
uint8_t board_state[ROWS][COLUMNS]{};
};