MCPcopy Create free account
hub / github.com/DFHack/dfhack / scan_back

Method scan_back

plugins/spectate.cpp:212–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 }
211
212 void scan_back(color_ostream &out) {
213 if (history.empty() || offset >= history.size()-1) {
214 DEBUG(cycle,out).print("already at beginning of history\n");
215 return;
216 }
217 ++offset;
218 int unit_id = get_cur_unit_id();
219 DEBUG(cycle,out).print("scanning back to unit {} at offset {}\n", unit_id, offset);
220 if (auto unit = df::unit::find(unit_id))
221 Gui::revealInDwarfmodeMap(Units::getPosition(unit), false, World::ReadPauseState());
222 plotinfo->follow_item = -1;
223 plotinfo->follow_unit = unit_id;
224 }
225
226 void scan_forward(color_ostream &out) {
227 if (history.empty() || offset == 0) {

Callers 1

spectate_followPrevFunction · 0.80

Calls 5

revealInDwarfmodeMapFunction · 0.85
findFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected