diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-11-04 02:37:02 -0500 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-11-04 02:37:02 -0500 |
| commit | 460b99583bcf6da4462f13ad75856283849904e7 (patch) | |
| tree | 9190ac1ce1a9623b1e4a1630bc34eeb5dc6043eb /wizard.cpp | |
| parent | 76bc3b3677062c0c1a6b9fa08ff20d12e470159c (diff) | |
| download | wizard-460b99583bcf6da4462f13ad75856283849904e7.tar.gz wizard-460b99583bcf6da4462f13ad75856283849904e7.tar.bz2 wizard-460b99583bcf6da4462f13ad75856283849904e7.zip | |
main.cpp does work for standalone entry
Diffstat (limited to 'wizard.cpp')
| -rw-r--r-- | wizard.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
| diff --git a/wizard.cpp b/wizard.cpp index 4eaefb3..1541fed 100644 --- a/wizard.cpp +++ b/wizard.cpp | |||
| @@ -38,13 +38,9 @@ class pix_deleter { | |||
| 38 | 38 | ||
| 39 | using pix_ptr = std::unique_ptr<Pix, pix_deleter>; | 39 | using pix_ptr = std::unique_ptr<Pix, pix_deleter>; |
| 40 | 40 | ||
| 41 | wizard::wizard(std::string cardsPath, std::string cachePath, | 41 | wizard::wizard(const cardset& cards, const imagestore& images, std::string text, |
| 42 | std::string outputPath, std::string jsonPath, std::mt19937& rng) | 42 | std::mt19937& rng) |
| 43 | : cards_(cardsPath), | 43 | : cards_(cards), images_(images), text_(text), rng_(rng()) { |
| 44 | images_(cachePath), | ||
| 45 | outputPath_(outputPath), | ||
| 46 | jsonPath_(jsonPath), | ||
| 47 | rng_(rng) { | ||
| 48 | std::cout << "Characters: "; | 44 | std::cout << "Characters: "; |
| 49 | 45 | ||
| 50 | for (char ch : cards_.getCharacters()) { | 46 | for (char ch : cards_.getCharacters()) { |
| @@ -54,8 +50,8 @@ wizard::wizard(std::string cardsPath, std::string cachePath, | |||
| 54 | std::cout << std::endl; | 50 | std::cout << std::endl; |
| 55 | } | 51 | } |
| 56 | 52 | ||
| 57 | void wizard::run() { | 53 | Magick::Image wizard::run() { |
| 58 | std::string text = "what the heck, it's just some gay guy"; | 54 | std::string text = text_; //"what the heck, it's just some gay guy"; |
| 59 | // getline(std::cin, text); | 55 | // getline(std::cin, text); |
| 60 | if (text.back() == '\r') { | 56 | if (text.back() == '\r') { |
| 61 | text.pop_back(); | 57 | text.pop_back(); |
| @@ -252,5 +248,6 @@ void wizard::run() { | |||
| 252 | } | 248 | } |
| 253 | 249 | ||
| 254 | endImage.magick("PNG"); | 250 | endImage.magick("PNG"); |
| 255 | endImage.write(outputPath_); | 251 | |
| 252 | return endImage; | ||
| 256 | } | 253 | } |
