t7x/src/client/loader/component_interface.hpp
2023-03-07 19:23:08 +01:00

55 lines
806 B
C++

#pragma once
enum class component_priority
{
min = 0,
// must run after the steam_proxy
name,
// must run after the updater
steam_proxy,
updater,
// must have the highest priority
arxan,
};
enum class component_type
{
client,
server,
any,
};
struct generic_component
{
static constexpr component_type type = component_type::any;
virtual ~generic_component() = default;
virtual void post_load()
{
}
virtual void pre_destroy()
{
}
virtual void post_unpack()
{
}
virtual component_priority priority() const
{
return component_priority::min;
}
};
struct client_component : generic_component
{
static constexpr component_type type = component_type::client;
};
struct server_component : generic_component
{
static constexpr component_type type = component_type::server;
};