MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getResearchProgress

Method getResearchProgress

src/Savegame/ResearchProject.cpp:137–166  ·  view source on GitHub ↗

* Return a string describing Research progress. * @return a string describing Research progress. */

Source from the content-addressed store, hash-verified

135 * @return a string describing Research progress.
136*/
137std::string ResearchProject::getResearchProgress () const
138{
139 float progress = (float)getSpent () / getRules ()->getCost();
140 if (getAssigned () == 0)
141 {
142 return "STR_NONE";
143 }
144 else if (progress < PROGRESS_LIMIT_UNKNOWN)
145 {
146 return "STR_UNKNOWN";
147 }
148 else
149 {
150 float rating = (float)getAssigned ();
151 rating /= getRules ()->getCost();
152 if (rating < PROGRESS_LIMIT_POOR)
153 {
154 return "STR_POOR";
155 }
156 else if (rating < PROGRESS_LIMIT_AVERAGE)
157 {
158 return "STR_AVERAGE";
159 }
160 else if (rating < PROGRESS_LIMIT_GOOD)
161 {
162 return "STR_GOOD";
163 }
164 return "STR_EXCELLENT";
165 }
166}
167}

Callers 1

fillProjectListMethod · 0.80

Calls 1

getCostMethod · 0.45

Tested by

no test coverage detected