76 lines
1.5 KiB
C++
76 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "../Core/Menu.h"
|
|
#include "Keybinds.h"
|
|
#include "PiecesType.h"
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
#include <vector>
|
|
|
|
static const int MAXIMUM_BOARD_WIDTH = 40;
|
|
static const int MAXIMUM_BOARD_HEIGHT = 40;
|
|
|
|
//#define __JMINOS_RELEASE__
|
|
#ifdef __JMINOS_RELEASE__
|
|
static const int MAXIMUM_PIECES_SIZE = 15;
|
|
#else
|
|
static const int MAXIMUM_PIECES_SIZE = 10;
|
|
#endif
|
|
|
|
|
|
class Settings {
|
|
private:
|
|
Menu menu;
|
|
std::vector<Keybinds> keybinds;
|
|
int chosenKeybinds;
|
|
int windowSizeMode;
|
|
int startTimerLength;
|
|
Gamemode gamemode;
|
|
std::vector<std::pair<PiecesType, int>> selectedPieces;
|
|
|
|
public:
|
|
Settings();
|
|
|
|
void loadSettingsFromFile();
|
|
|
|
void saveSettingsToFile() const;
|
|
|
|
bool selectNextKeybinds();
|
|
|
|
bool selectPreviousKeybinds();
|
|
|
|
bool canModifyCurrentKeybinds() const;
|
|
|
|
bool widenWindow();
|
|
|
|
bool shortenWindow();
|
|
|
|
void changeVideoMode(sf::RenderWindow& window) const;
|
|
|
|
bool lengthenStartTimer();
|
|
|
|
bool shortenStartTimer();
|
|
|
|
void setGamemode(Gamemode gamemode);
|
|
|
|
void selectPieces(PiecesType type, int value);
|
|
|
|
void unselectPieces(int index);
|
|
|
|
void confirmSelectedPieces();
|
|
|
|
Menu& getMenu();
|
|
|
|
Keybinds& getKeybinds();
|
|
|
|
int getKeybindsLayout() const;
|
|
|
|
Gamemode getGamemode() const;
|
|
|
|
int getWindowSizeMultiplier() const;
|
|
|
|
int getStartTimerLength() const;
|
|
|
|
const std::vector<std::pair<PiecesType, int>>& getSelectedPieces() const;
|
|
};
|