sliding-puzzle/argsprocessor.h

30 lines
734 B
C++

#ifndef ARGSPROCESSOR_H
#define ARGSPROCESSOR_H
#include <SFML/Graphics/VertexArray.hpp>
#include <string>
class ArgsProcessor
{
public:
ArgsProcessor(int argc, char **argv);
int broken() const;
std::tuple<int, sf::Vector2i, std::string> unpack() const;
private:
bool isFlag(const char* arg, const char* flag) const;
int tryConvertInput(int argc, char **argv);
int iterateArgc(int argc, char **argv);
int makeError(const char* msg) const;
int parseSplitting(int curr_arg, int argc, char **argv);
int parseResolution(int curr_arg, int argc, char **argv);
int parse_result;
int image_splitting;
sf::Vector2i game_resolution;
std::string image_path;
};
#endif // ARGSPROCESSOR_H