#pragma once #include "../Core/Menu.h" #include "Keybinds.h" #include "PiecesType.h" #include #include static const int CURRENT_FILE_FORMAT_VERSION = 10; static const int MAXIMUM_BOARD_WIDTH = 40; static const int MAXIMUM_BOARD_HEIGHT = 40; static const int MINIMUM_PIECES_SIZE = 4; static const int MAXIMUM_PIECES_SIZE = 15; //#define __JMINOS_RELEASE__ #ifdef __JMINOS_RELEASE__ static const int LOADED_PIECES_SIZE = 15; #else static const int LOADED_PIECES_SIZE = 10; #endif static const std::pair DEFAULT_SELECTION = {ALL_PIECES, MINIMUM_PIECES_SIZE}; class Settings { private: Menu menu; int maximumPiecesSize; bool loadedPieces; std::vector keybinds; int chosenKeybinds; int windowSizeMode; int startTimerLength; Gamemode gamemode; std::vector> selectedPieces; std::vector distributions; public: Settings(bool loadPieces); private: bool loadPieces(int maximumPiecesSizeRequest); public: void loadSettingsFromFile(bool loadPieces = true); 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(); bool increaseDistribution(int size); bool decreaseDistribution(int size); void confirmDistribution(); Menu& getMenu(); Keybinds& getKeybinds(); int getMaximumPiecesSize() const; bool hasLoadedPieces() const; int getKeybindsLayout() const; Gamemode getGamemode() const; int getWindowSizeMultiplier() const; int getStartTimerLength() const; const std::vector>& getSelectedPieces() const; const std::vector& getDistributions() const; };