| 1 | /*************************************************************************** |
| 2 | hop.cpp |
| 3 | ------------------- |
| 4 | A hop class |
| 5 | ------------------- |
| 6 | Copyright 1999-2008, David Johnson |
| 7 | Please see the header file for copyright and license information |
| 8 | ***************************************************************************/ |
| 9 | |
| 10 | #include <QStringList> |
| 11 | #include "resource.h"cxx . . $ `<file>/src/resource.h`/ |
| 12 | #include "hop.h"cxx . . $ `<file>/src/hop.h`/ |
| 13 | |
| 14 | const QByteArraycxx . . $ QByteArray# Hopcxx . . $ Hop#::PELLET_STRINGcxx . . $ Hop#PELLET_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("Hop", "Pellet"); |
| 15 | const QByteArraycxx . . $ QByteArray# Hopcxx . . $ Hop#::PLUG_STRINGcxx . . $ Hop#PLUG_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("Hop", "Plug"); |
| 16 | const QByteArraycxx . . $ QByteArray# Hopcxx . . $ Hop#::WHOLE_STRINGcxx . . $ Hop#WHOLE_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("Hop", "Whole"); |
| 17 | |
| 18 | ////////////////////////////////////////////////////////////////////////////// |
| 19 | // Hop() |
| 20 | // ----- |
| 21 | // constructor |
| 22 | |
| 23 | Hopcxx . . $ Hop#::Hopcxx . . $ Hop#Hop(49f6e7a06ebc5aa8).() |
| 24 | : name_cxx . . $ Hop#name_.(QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("Generic")), weight_cxx . . $ Hop#weight_.(), type_cxx . . $ Hop#type_.(PELLET_STRINGcxx . . $ Hop#PELLET_STRING.), |
| 25 | alpha_cxx . . $ Hop#alpha_.(10.0), time_cxx . . $ Hop#time_.(0) |
| 26 | { ; } |
| 27 | |
| 28 | Hopcxx . . $ Hop#::Hopcxx . . $ Hop#Hop(c3d816628ae0b20).(const QStringcxx . . $ QString# &name, const Weightcxx . . $ Weight# &weight, const QStringcxx . . $ QString# &typ, |
| 29 | const double &alpha, const unsigned &time) |
| 30 | : name_cxx . . $ Hop#name_.(name), weight_cxx . . $ Hop#weight_.(weight), type_cxx . . $ Hop#type_.(typ), alpha_cxx . . $ Hop#alpha_.(alpha), time_cxx . . $ Hop#time_.(time) |
| 31 | |
| 32 | { |
| 33 | recalccxx . . $ Hop#recalc(49f6e7a06ebc5aa8).(); |
| 34 | } |
| 35 | |
| 36 | Hopcxx . . $ Hop#::~cxx . . $ Hop#`~Hop`(ced63f7c635d850d).Hopcxx . . $ Hop#() { ; } |
| 37 | |
| 38 | ////////////////////////////////////////////////////////////////////////////// |
| 39 | // Hop(const Hop &) |
| 40 | // ---------------- |
| 41 | // Copy constructor |
| 42 | |
| 43 | Hopcxx . . $ Hop#::Hopcxx . . $ Hop#Hop(1ff9fed636ba4a7f).(const Hopcxx . . $ Hop# &h) |
| 44 | : name_cxx . . $ Hop#name_.(h.name_cxx . . $ Hop#name_.), weight_cxx . . $ Hop#weight_.(h.weight_cxx . . $ Hop#weight_.), type_cxx . . $ Hop#type_.(h.type_cxx . . $ Hop#type_.), alpha_cxx . . $ Hop#alpha_.(h.alpha_cxx . . $ Hop#alpha_.), |
| 45 | time_cxx . . $ Hop#time_.(h.time_cxx . . $ Hop#time_.), hbu_cxx . . $ Hop#hbu_.(h.hbu_cxx . . $ Hop#hbu_.) |
| 46 | { ; } |
| 47 | |
| 48 | ////////////////////////////////////////////////////////////////////////////// |
| 49 | // operator=() |
| 50 | // ----------- |
| 51 | // Assignment operator |
| 52 | |
| 53 | Hopcxx . . $ Hop# Hopcxx . . $ Hop#::operatorcxx . . $ Hop#`operator=`(a5d063c8d945c6bf).=(const Hopcxx . . $ Hop# &h) |
| 54 | { |
| 55 | if (this != &h) { |
| 56 | name_cxx . . $ Hop#name_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). h.name_cxx . . $ Hop#name_.; |
| 57 | weight_cxx . . $ Hop#weight_. =cxx . . $ Weight#`operator=`(39a9bb3108e78fa6). h.weight_cxx . . $ Hop#weight_.; |
| 58 | type_cxx . . $ Hop#type_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). h.type_cxx . . $ Hop#type_.; |
| 59 | alpha_cxx . . $ Hop#alpha_. = h.alpha_cxx . . $ Hop#alpha_.; |
| 60 | time_cxx . . $ Hop#time_. = h.time_cxx . . $ Hop#time_.; |
| 61 | hbu_cxx . . $ Hop#hbu_. = h.hbu_cxx . . $ Hop#hbu_.; |
| 62 | } |
| 63 | return *cxx . . $ Hop#Hop(1ff9fed636ba4a7f).this; |
| 64 | } |
| 65 | |
| 66 | ////////////////////////////////////////////////////////////////////////////// |
| 67 | // operator==() |
| 68 | // ------------ |
| 69 | // Equivalence operator |
| 70 | |
| 71 | bool Hopcxx . . $ Hop#::operatorcxx . . $ Hop#`operator==`(a8a5c2d1f45d23cd).==(const Hopcxx . . $ Hop# &h) const |
| 72 | { |
| 73 | return (name_cxx . . $ Hop#name_. ==cxx . . $ `operator==`(5bc2975d2d751687). h.name_cxx . . $ Hop#name_.) |
| 74 | && (weight_cxx . . $ Hop#weight_. ==cxx . . $ Quantity#`operator==`(bc25df371a14fcfa). h.weight_cxx . . $ Hop#weight_.) |
| 75 | && (type_cxx . . $ Hop#type_. ==cxx . . $ `operator==`(5bc2975d2d751687). h.type_cxx . . $ Hop#type_.) |
| 76 | && (alpha_cxx . . $ Hop#alpha_. == h.alpha_cxx . . $ Hop#alpha_.) |
| 77 | && (time_cxx . . $ Hop#time_. == h.time_cxx . . $ Hop#time_.); |
| 78 | } |
| 79 | |
| 80 | ////////////////////////////////////////////////////////////////////////////// |
| 81 | // typeStringList() |
| 82 | // ---------------- |
| 83 | // Return string list of available hop types |
| 84 | |
| 85 | QStringListcxx . . $ QStringList# Hopcxx . . $ Hop#::typeStringListcxx . . $ Hop#typeStringList(669a05bc42dd57cc).() |
| 86 | { |
| 87 | return (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).() <<cxx . . $ QStringList#`operator<<`(85116071a693d053). PELLET_STRINGcxx . . $ QString#QString(45672f3c6961a244). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). PLUG_STRINGcxx . . $ QString#QString(45672f3c6961a244). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). WHOLE_STRINGcxx . . $ QString#QString(45672f3c6961a244).); |
| 88 | } |
| 89 | |
| 90 | //////////////////////////////////////////////////////////3///////////////////// |
| 91 | // recalc() |
| 92 | // -------- |
| 93 | // Recalculate internal values |
| 94 | |
| 95 | void Hopcxx . . $ Hop#::recalccxx . . $ Hop#recalc(49f6e7a06ebc5aa8).() |
| 96 | { |
| 97 | hbu_cxx . . $ Hop#hbu_. = 0.75 * alpha_cxx . . $ Hop#alpha_. * weight_cxx . . $ Hop#weight_..amountcxx . . $ Quantity#amount(4f9526ff0a26ae42).(Weightcxx . . $ Weight#::ouncecxx . . $ Weight#ounce.); |
| 98 | } |