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

Method save

plugins/manipulator.cpp:706–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704 return true;
705 }
706 bool save(string directory)
707 {
708 std::ofstream outfile(directory + "/" + name);
709 if (outfile.bad())
710 return false;
711
712 outfile << "NAME " << name << std::endl;
713 if (mask)
714 outfile << "MASK" << std::endl;
715
716 for (size_t i = 0; i < NUM_COLUMNS; i++)
717 {
718 if (hasLabor(columns[i].labor))
719 {
720 outfile << ENUM_KEY_STR(unit_labor, columns[i].labor) << std::endl;
721 }
722 }
723
724 outfile.flush();
725 outfile.close();
726 return true;
727 }
728
729 void apply(UnitInfo* u)
730 {

Callers 1

save_from_unitMethod · 0.45

Calls 2

flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected