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

Method onUpdate

library/Core.cpp:1663–1684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1661static int buildings_timer = 0;
1662
1663void Core::onUpdate(color_ostream &out)
1664{
1665 Gui::clearFocusStringCache();
1666
1667 uint32_t step_start_ms = p->getTickCount();
1668 EventManager::manageEvents(out);
1669 perf_counters.incCounter(perf_counters.update_event_manager_ms, step_start_ms);
1670
1671 // convert building reagents
1672 if (buildings_do_onupdate && (++buildings_timer & 1))
1673 buildings_onUpdate(out);
1674
1675 // notify all the plugins that a game tick is finished
1676 step_start_ms = p->getTickCount();
1677 plug_mgr->OnUpdate(out);
1678 perf_counters.incCounter(perf_counters.update_plugin_ms, step_start_ms);
1679
1680 // process timers in lua
1681 step_start_ms = p->getTickCount();
1682 Lua::Core::onUpdate(out);
1683 perf_counters.incCounter(perf_counters.update_lua_ms, step_start_ms);
1684}
1685
1686static void getFilesWithPrefixAndSuffix(const std::filesystem::path& folder, const std::string& prefix, const std::string& suffix, std::vector<std::filesystem::path>& result) {
1687 std::vector<std::filesystem::path> files;

Callers

nothing calls this directly

Calls 4

buildings_onUpdateFunction · 0.85
getTickCountMethod · 0.80
incCounterMethod · 0.80
OnUpdateMethod · 0.80

Tested by

no test coverage detected