MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / writeToObjective

Method writeToObjective

plugins/dm.objectives/DifficultyPanel.cpp:96–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void DifficultyPanel::writeToObjective(Objective& obj)
97{
98 // Set the difficulty to "all levels" per default
99 obj.difficultyLevels = "";
100
101 if (!_allLevels->GetValue())
102 {
103 // Not applicable to all difficulty levels, form the string
104 for (std::size_t i = 0; i < _toggles.size(); i++)
105 {
106 // Check each toggle button
107 if (_toggles[i]->GetValue())
108 {
109 std::string prefix = (!obj.difficultyLevels.empty()) ? " " : "";
110 obj.difficultyLevels += prefix + string::to_string(i);
111 }
112 }
113 }
114}
115
116} // namespace objectives

Callers 1

saveMethod · 0.80

Calls 4

to_stringFunction · 0.50
GetValueMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected