![]() |
ITEM Struct ReferenceITEM properties struct. More...
Collaboration diagram for ITEM: ![]()
Detailed DescriptionITEM properties struct.
Definition at line 43 of file ItemFactory.h. Constructor & Destructor Documentation
Definition at line 113 of file ItemFactory.cpp. References m_magical, m_name, m_physical, and m_plural. 00114 :m_vecno(0) 00115 ,m_wield_position(w),m_physical(20),m_magical(20),m_amount(1) 00116 { 00117 std::string cols[10]; // nrgybmcw 00118 for (size_t i = 0; i < 10; i++) 00119 { 00120 int nr = random() % 8; 00121 if (!nr) 00122 { 00123 nr = random() % 15 + 1; 00124 } 00125 cols[i] = "&"; 00126 cols[i] += "nrgybmcwRGYBMCWL"[nr]; 00127 } 00128 size_t col = 0; 00129 for (size_t i = 0; i < n.size(); i++) 00130 { 00131 if (n[i] == ' ') 00132 { 00133 m_name += " "; 00134 m_name += cols[col++]; 00135 } 00136 else 00137 { 00138 m_name += n.substr(i,1); //n[i]; 00139 } 00140 } 00141 col = 0; 00142 m_plural += cols[col++]; 00143 for (size_t i = 0; i < p.size(); i++) 00144 { 00145 if (p[i] == ' ') 00146 { 00147 m_plural += " "; 00148 m_plural += cols[col++]; 00149 } 00150 else 00151 { 00152 m_plural += p.substr(i,1); //p[i]; 00153 } 00154 } 00155 if (!random() % 100) 00156 { 00157 m_physical += random() % 80 + 1; 00158 if (!random() % 100) 00159 { 00160 m_magical += random() % 80 + 1; 00161 } 00162 } 00163 m_name += "&n"; 00164 m_plural += "&n"; 00165 }
Definition at line 168 of file ItemFactory.cpp. 00169 :m_vecno(0) 00170 ,m_name(n) 00171 ,m_plural(p) 00172 ,m_wield_position(w),m_physical(ph),m_magical(ma),m_amount(am) 00173 { 00174 }
Member Function Documentation
Definition at line 46 of file ItemFactory.h. References m_amount, m_name, m_plural, and m_vecno. 00047 { 00048 std::string str; 00049 if (m_amount == 1) 00050 { 00051 str = m_name; 00052 } 00053 else 00054 { 00055 str = Utility::l2string(m_amount) + " " + m_plural; 00056 } 00057 if (m_vecno > 0) 00058 { 00059 str += " (" + Utility::l2string(m_vecno) + ")"; 00060 } 00061 return str; 00062 }
Member Data Documentation
Definition at line 66 of file ItemFactory.h.
The documentation for this struct was generated from the following files: |