solanaceae_factorio/src/factorio.hpp
Green Sky 6aa90a1852
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
make forwarding configurable
2025-01-12 13:37:35 +01:00

42 lines
1.3 KiB
C++

#pragma once
#include <solanaceae/message3/registry_message_model.hpp>
#include "./factorio_log_parser.hpp"
#include <vector>
// fwd
struct ConfigModelI;
class Factorio : public RegistryMessageModelEventI, public FactorioLogParserEventI {
ConfigModelI& _conf;
Contact3Registry& _cr;
RegistryMessageModelI& _rmm;
RegistryMessageModelI::SubscriptionReference _rmm_sr;
FactorioLogParser& _flp;
FactorioLogParser::SubscriptionReference _flp_sr;
std::vector<Contact3Handle> _linked_contacts;
void sendToLinked(const std::string& message);
public:
Factorio(ConfigModelI& conf, Contact3Registry& cr, RegistryMessageModelI& rmm, FactorioLogParser& flp);
virtual ~Factorio(void);
protected: // rmm
bool onEvent(const Message::Events::MessageConstruct& e) override;
protected: // flp
bool onEvent(const FactorioLog::Events::Join&) override;
bool onEvent(const FactorioLog::Events::Leave&) override;
bool onEvent(const FactorioLog::Events::Chat&) override;
bool onEvent(const FactorioLog::Events::Died&) override;
bool onEvent(const FactorioLog::Events::Evolution&) override;
bool onEvent(const FactorioLog::Events::ResearchStarted&) override;
bool onEvent(const FactorioLog::Events::ResearchFinished&) override;
bool onEvent(const FactorioLog::Events::ResearchCancelled&) override;
};