t7x/src/client/loader/component_interface.hpp

55 lines
806 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 steam_proxy
name,
2022-11-11 11:00:34 -05:00
// 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,
};
2023-01-01 15:51:04 -05:00
struct generic_component
2023-01-01 15:46:36 -05:00
{
static constexpr component_type type = component_type::any;
2023-01-01 15:51:04 -05:00
virtual ~generic_component() = default;
2022-05-21 06:04:08 -04:00
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
2023-01-01 15:51:04 -05:00
struct client_component : generic_component
2023-01-01 15:46:36 -05:00
{
static constexpr component_type type = component_type::client;
};
2023-01-01 15:51:04 -05:00
struct server_component : generic_component
2023-01-01 15:46:36 -05:00
{
static constexpr component_type type = component_type::server;
};