MCPcopy Create free account
hub / github.com/davemoore22/sorcery / load_state_from_binary

Method load_state_from_binary

src/core/application.cpp:143–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143auto Sorcery::Application::load_state_from_binary(const std::string &filename)
144 -> bool {
145
146 std::ifstream is(filename, std::ios::binary);
147 if (!is.is_open()) {
148 std::cerr << "Error: could not open " << filename << " for reading.\n";
149 return false;
150 }
151
152 // Note we serialize INTO existing objects thus no need to reinject
153 cereal::BinaryInputArchive archive(is);
154 archive(*_game, *_controller);
155
156 DEBUG_LOGF("Quicksave successfully loaded from {}!", filename);
157
158 return true;
159}
160
161// Default Destructor
162Sorcery::Application::~Application() {}

Callers 2

startMethod · 0.80
startMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected