diff options
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
| diff --git a/main.cpp b/main.cpp index a0ba7bb..9327c20 100644 --- a/main.cpp +++ b/main.cpp | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | #include <iostream> | 4 | #include <iostream> |
| 5 | #include <string> | 5 | #include <string> |
| 6 | 6 | ||
| 7 | #include "cardset.h" | ||
| 8 | #include "imagestore.h" | ||
| 7 | #include "wizard.h" | 9 | #include "wizard.h" |
| 8 | 10 | ||
| 9 | int main(int argc, char** argv) { | 11 | int main(int argc, char** argv) { |
| @@ -29,16 +31,18 @@ int main(int argc, char** argv) { | |||
| 29 | "o", "output", "Path to write image output to", true, "", "filename"); | 31 | "o", "output", "Path to write image output to", true, "", "filename"); |
| 30 | cmd.add(outputPath); | 32 | cmd.add(outputPath); |
| 31 | 33 | ||
| 32 | TCLAP::ValueArg<std::string> jsonPath( | 34 | TCLAP::ValueArg<std::string> textInput("t", "text", "Text to render", true, |
| 33 | "j", "json", "Path to write JSON output to", false, "", "filename"); | 35 | "", "text"); |
| 34 | cmd.add(jsonPath); | 36 | cmd.add(textInput); |
| 35 | 37 | ||
| 36 | cmd.parse(argc, argv); | 38 | cmd.parse(argc, argv); |
| 37 | 39 | ||
| 38 | wizard app(cardsPath.getValue(), cachePath.getValue(), | 40 | cardset cards(cardsPath.getValue()); |
| 39 | outputPath.getValue(), jsonPath.getValue(), rng); | 41 | imagestore images(cachePath.getValue()); |
| 40 | 42 | ||
| 41 | app.run(); | 43 | wizard app(cards, images, textInput.getValue(), rng); |
| 44 | Magick::Image result = app.run(); | ||
| 45 | result.write(outputPath.getValue()); | ||
| 42 | } catch (const TCLAP::ArgException& e) { | 46 | } catch (const TCLAP::ArgException& e) { |
| 43 | std::cerr << "Error: " << e.error() << " for arg " << e.argId() | 47 | std::cerr << "Error: " << e.error() << " for arg " << e.argId() |
| 44 | << std::endl; | 48 | << std::endl; |
