30 lines
585 B
C++
30 lines
585 B
C++
#pragma once
|
|
|
|
#include <SFML/Window/Keyboard.hpp>
|
|
#include "board.h"
|
|
|
|
class Application
|
|
{
|
|
public:
|
|
explicit Application(unsigned int window_width, unsigned int window_height);
|
|
|
|
// Init game
|
|
bool init(const std::string& path, int splitting);
|
|
|
|
// Launch game
|
|
void run();
|
|
|
|
// Refresh render_window to actual state
|
|
void draw();
|
|
|
|
// Handle keyboard commands
|
|
void processInput();
|
|
|
|
private:
|
|
// Convert keyboard keys into moving direction
|
|
DIRECTION getDirection(sf::Keyboard::Key &key) const;
|
|
|
|
Board board;
|
|
sf::RenderWindow render_window;
|
|
};
|