sliding-puzzle/application.h

27 lines
459 B
C
Raw Normal View History

2020-12-13 13:45:52 -05:00
#pragma once
#include <SFML/Window/Keyboard.hpp>
#include "board.h"
class Application
{
public:
explicit Application();
2020-12-14 14:22:52 -05:00
// Launch game
2020-12-13 13:45:52 -05:00
void run();
2020-12-14 14:22:52 -05:00
// Refresh render_window to actual state
2020-12-13 13:45:52 -05:00
void draw();
2020-12-14 14:22:52 -05:00
// Handle keyboard commands
void processInput();
2020-12-13 13:45:52 -05:00
private:
2020-12-14 14:22:52 -05:00
// Convert keyboard keys into moving direction
2020-12-13 13:45:52 -05:00
DIRECTION getDirection(sf::Keyboard::Key &key) const;
Board board;
sf::RenderWindow render_window;
};