load path from config, follow log file, working reopening
Some checks failed
ContinuousIntegration / linux (push) Successful in 23s
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled

This commit is contained in:
2024-06-11 12:02:53 +02:00
parent 6f6894419a
commit e1e2563ac2
4 changed files with 94 additions and 19 deletions

View File

@ -3,6 +3,8 @@
#include <entt/entt.hpp>
#include <entt/fwd.hpp>
#include <solanaceae/util/config_model.hpp>
#include "factorio_log_parser.hpp"
#include "factorio.hpp"
@ -31,12 +33,13 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
}
try {
auto* conf = PLUG_RESOLVE_INSTANCE(ConfigModelI);
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModel);
// static store, could be anywhere tho
// construct with fetched dependencies
g_flp = std::make_unique<FactorioLogParser>();
g_flp = std::make_unique<FactorioLogParser>(*conf);
g_f = std::make_unique<Factorio>(*cr, *rmm, *g_flp);
// register types
@ -57,9 +60,8 @@ SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void) {
g_flp.reset();
}
SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float) {
//return g_rpbot->tick(delta);
return 1000.f;
SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta) {
return g_flp->tick(delta);
}
} // extern C