Debian Codegraph @

src/grain.cpp

raw symbols SCIP
1 /***************************************************************************
2 grain.cpp
3 -------------------
4 A grain class
5 -------------------
6 Copyright 1999-2008, David Johnson
7 Please see the header file for copyright and license information
8 ***************************************************************************/
9
10 #include "resource.h"cxx . . $ `<file>/src/resource.h`/
11 #include "grain.h"cxx . . $ `<file>/src/grain.h`/
12
13 using namespace Resource;
14
15 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::EXTRACT_STRINGcxx . . $ Grain#EXTRACT_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Extract");
16 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::MASHED_STRINGcxx . . $ Grain#MASHED_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Mashed");
17 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::STEEPED_STRINGcxx . . $ Grain#STEEPED_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Steeped");
18 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::GRAIN_STRINGcxx . . $ Grain#GRAIN_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Grain");
19 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::ADJUNCT_STRINGcxx . . $ Grain#ADJUNCT_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Adjunct");
20 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::SUGAR_STRINGcxx . . $ Grain#SUGAR_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Sugar");
21 const QByteArraycxx . . $ QByteArray# Graincxx . . $ Grain#::OTHER_STRINGcxx . . $ Grain#OTHER_STRING. = QT_TRANSLATE_NOOPcxx . . $ `<external>/15045578679651060896/qglobal.h:1182:9`!("grain", "Other");
22
23 //////////////////////////////////////////////////////////////////////////////
24 // Grain()
25 // -------
26 // Constructor
27
28 Graincxx . . $ Grain#::Graincxx . . $ Grain#Grain(49f6e7a06ebc5aa8).()
29 : name_cxx . . $ Grain#name_.(QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("Generic")), weight_cxx . . $ Grain#weight_.(), extract_cxx . . $ Grain#extract_.(1.025), color_cxx . . $ Grain#color_.(1.0),
30 type_cxx . . $ Grain#type_.(GRAIN_STRINGcxx . . $ Grain#GRAIN_STRING.), use_cxx . . $ Grain#use_.(OTHER_STRINGcxx . . $ Grain#OTHER_STRING.), yield_cxx . . $ Grain#yield_.(0.0), hcu_cxx . . $ Grain#hcu_.(0.0)
31 { ; }
32
33 Graincxx . . $ Grain#::Graincxx . . $ Grain#Grain(3be43a66133ffe7e).(const QStringcxx . . $ QString# &name, const Weightcxx . . $ Weight# &weight, const double &extract,
34 const double &color, const QStringcxx . . $ QString# &typ, const QStringcxx . . $ QString# &use)
35 : name_cxx . . $ Grain#name_.(name), weight_cxx . . $ Grain#weight_.(weight), extract_cxx . . $ Grain#extract_.(extract), color_cxx . . $ Grain#color_.(color),
36 type_cxx . . $ Grain#type_.(typ), use_cxx . . $ Grain#use_.(use)
37 {
38 recalccxx . . $ Grain#recalc(49f6e7a06ebc5aa8).();
39 }
40
41 Graincxx . . $ Grain#::~cxx . . $ Grain#`~Grain`(ced63f7c635d850d).Graincxx . . $ Grain#() { ; }
42
43 //////////////////////////////////////////////////////////////////////////////
44 // Grain(const Grain&)
45 // --------------------
46 // Copy Constructor
47
48 Graincxx . . $ Grain#::Graincxx . . $ Grain#Grain(a6c84258c6f1c14e).(const Graincxx . . $ Grain# &g)
49 : name_cxx . . $ Grain#name_.(g.name_cxx . . $ Grain#name_.), weight_cxx . . $ Grain#weight_.(g.weight_cxx . . $ Grain#weight_.), extract_cxx . . $ Grain#extract_.(g.extract_cxx . . $ Grain#extract_.),
50 color_cxx . . $ Grain#color_.(g.color_cxx . . $ Grain#color_.), type_cxx . . $ Grain#type_.(g.type_cxx . . $ Grain#type_.), use_cxx . . $ Grain#use_.(g.use_cxx . . $ Grain#use_.), yield_cxx . . $ Grain#yield_.(g.yield_cxx . . $ Grain#yield_.),
51 hcu_cxx . . $ Grain#hcu_.(g.hcu_cxx . . $ Grain#hcu_.)
52 { ; }
53
54 //////////////////////////////////////////////////////////////////////////////
55 // operator=()
56 // -----------
57 // Assignment operator
58
59 Graincxx . . $ Grain# Graincxx . . $ Grain#::operatorcxx . . $ Grain#`operator=`(7fead45929ea56fe).=(const Graincxx . . $ Grain# &g)
60 {
61 if (this != &g) {
62 name_cxx . . $ Grain#name_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). g.name_cxx . . $ Grain#name_.;
63 weight_cxx . . $ Grain#weight_. =cxx . . $ Weight#`operator=`(39a9bb3108e78fa6). g.weight_cxx . . $ Grain#weight_.;
64 extract_cxx . . $ Grain#extract_. = g.extract_cxx . . $ Grain#extract_.;
65 color_cxx . . $ Grain#color_. = g.color_cxx . . $ Grain#color_.;
66 type_cxx . . $ Grain#type_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). g.type_cxx . . $ Grain#type_.;
67 use_cxx . . $ Grain#use_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). g.use_cxx . . $ Grain#use_.;
68 yield_cxx . . $ Grain#yield_. = g.yield_cxx . . $ Grain#yield_.;
69 hcu_cxx . . $ Grain#hcu_. = g.hcu_cxx . . $ Grain#hcu_.;
70 }
71 return *cxx . . $ Grain#Grain(a6c84258c6f1c14e).this;
72 }
73
74 //////////////////////////////////////////////////////////////////////////////
75 // operator==()
76 // ------------
77 // Equivalence operator
78
79 bool Graincxx . . $ Grain#::operatorcxx . . $ Grain#`operator==`(ca4418267d9a1f1d).==(const Graincxx . . $ Grain# &g) const
80 {
81 return (name_cxx . . $ Grain#name_. ==cxx . . $ `operator==`(5bc2975d2d751687). g.name_cxx . . $ Grain#name_.)
82 && (weight_cxx . . $ Grain#weight_. ==cxx . . $ Quantity#`operator==`(bc25df371a14fcfa). g.weight_cxx . . $ Grain#weight_.)
83 && (extract_cxx . . $ Grain#extract_. == g.extract_cxx . . $ Grain#extract_.)
84 && (color_cxx . . $ Grain#color_. == g.color_cxx . . $ Grain#color_.)
85 && (type_cxx . . $ Grain#type_. ==cxx . . $ `operator==`(5bc2975d2d751687). g.type_cxx . . $ Grain#type_.)
86 && (use_cxx . . $ Grain#use_. ==cxx . . $ `operator==`(5bc2975d2d751687). g.use_cxx . . $ Grain#use_.);
87 }
88
89 ///////////////////////////////////////////////////////////////////////////////
90 // typeStringList()
91 // ----------------
92 // Return string list of grain types
93
94 QStringListcxx . . $ QStringList# Graincxx . . $ Grain#::typeStringListcxx . . $ Grain#typeStringList(669a05bc42dd57cc).()
95 {
96 return (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).()
97 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). GRAIN_STRINGcxx . . $ QString#QString(45672f3c6961a244).
98 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). EXTRACT_STRINGcxx . . $ QString#QString(45672f3c6961a244).
99 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ADJUNCT_STRINGcxx . . $ QString#QString(45672f3c6961a244).
100 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). SUGAR_STRINGcxx . . $ QString#QString(45672f3c6961a244).
101 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). OTHER_STRINGcxx . . $ QString#QString(45672f3c6961a244).);
102 }
103
104 ///////////////////////////////////////////////////////////////////////////////
105 // useStringList()
106 // -----------
107 // Return string list of usage types
108
109 QStringListcxx . . $ QStringList# Graincxx . . $ Grain#::useStringListcxx . . $ Grain#useStringList(669a05bc42dd57cc).()
110 {
111 return (QStringListcxx . . $ QStringList#QStringList(ced63f7c635d850d).()
112 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). EXTRACT_STRINGcxx . . $ QString#QString(45672f3c6961a244).
113 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). MASHED_STRINGcxx . . $ QString#QString(45672f3c6961a244).
114 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). STEEPED_STRINGcxx . . $ QString#QString(45672f3c6961a244).
115 <<cxx . . $ QStringList#`operator<<`(85116071a693d053). OTHER_STRINGcxx . . $ QString#QString(45672f3c6961a244).);
116 }
117
118 ///////////////////////////////////////////////////////////////////////////////
119 // recalc()
120 // --------
121 // Recalculate internal values
122
123 void Graincxx . . $ Grain#::recalccxx . . $ Grain#recalc(49f6e7a06ebc5aa8).()
124 {
125 yield_cxx . . $ Grain#yield_. = weight_cxx . . $ Grain#weight_..amountcxx . . $ Quantity#amount(4f9526ff0a26ae42).(Weightcxx . . $ Weight#::poundcxx . . $ Weight#pound.) * (extract_cxx . . $ Grain#extract_. - 1.000);
126 hcu_cxx . . $ Grain#hcu_. = weight_cxx . . $ Grain#weight_..amountcxx . . $ Quantity#amount(4f9526ff0a26ae42).(Weightcxx . . $ Weight#::poundcxx . . $ Weight#pound.) * color_cxx . . $ Grain#color_.;
127 }