#pragma once

#include <vector>
#include <cstdint>

namespace logic {

class Board {
public:
    static constexpr int Width = 10;
    static constexpr int Height = 20;

    enum class Cell : uint8_t { Empty = 0, Filled = 1 };

    Board();

    void clear();

    Cell at(int x, int y) const;
    void set(int x, int y, Cell c);
    bool inBounds(int x, int y) const;

    // Remove and return number of full lines cleared. Rows above fall down.
    int clearFullLines();

    const std::vector<Cell>& data() const { return grid_; }

private:
    std::vector<Cell> grid_; // row-major: y*Width + x
};

} // namespace logic
