summary refs log tree commit diff stats
path: root/wizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wizard.cpp')
-rw-r--r--wizard.cpp17
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
39using pix_ptr = std::unique_ptr<Pix, pix_deleter>; 39using pix_ptr = std::unique_ptr<Pix, pix_deleter>;
40 40
41wizard::wizard(std::string cardsPath, std::string cachePath, 41wizard::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
57void wizard::run() { 53Magick::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}