t7x/src/client/loader/component_interface.hpp

53 lines
792 B
C++
Raw Normal View History

2022-05-21 06:04:08 -04:00
#pragma once
2022-11-11 11:00:34 -05:00
enum class component_priority
{
min = 0,
// must run after the updater
steam_proxy,
updater,
// must have the highest priority
arxan,
};
2023-01-01 15:46:36 -05:00
enum class component_type
2022-05-21 06:04:08 -04:00
{
2023-01-01 15:46:36 -05:00
client,
server,
any,
};
struct component_interface
{
static constexpr component_type type = component_type::any;
2022-05-21 06:04:08 -04:00
virtual ~component_interface() = default;
virtual void post_load()
2022-05-21 06:04:08 -04:00
{
}
virtual void pre_destroy()
{
}
virtual void post_unpack()
{
}
2022-11-11 11:00:34 -05:00
virtual component_priority priority() const
2022-06-16 06:12:36 -04:00
{
2022-11-11 11:00:34 -05:00
return component_priority::min;
2022-06-16 06:12:36 -04:00
}
2022-05-21 06:04:08 -04:00
};
2023-01-01 15:46:36 -05:00
struct client_component_interface : component_interface
{
static constexpr component_type type = component_type::client;
};
struct server_component_interface : component_interface
{
static constexpr component_type type = component_type::server;
};