1
0
Fork 0
Univerxel/src/client/world/index.cpp

21 lines
724 B
C++

#include "index.hpp"
#ifndef STANDALONE
#include "LocalUniverse.hpp"
#endif
#include "DistantUniverse.hpp"
#include "../../core/utils/logger.hpp"
namespace world::client {
std::unique_ptr<Universe> Load(const std::optional<Universe::connection>& ct, server_handle *const localHandle, const Universe::options &distOpts) {
if(ct.has_value()) {
return std::make_unique<DistantUniverse>(ct.value(), distOpts);
#ifndef STANDALONE
} else if(localHandle != nullptr) {
LOG_D("Using local universe");
return std::make_unique<LocalUniverse>(localHandle);
#endif
} else {
FATAL("Must enable server.allow_local or define client.connection");
}
}
}