libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
cs_param.hpp
1
8#pragma once
9
10#include <detail/optref.hpp>
11#include <detail/preprocessor.hpp>
14#include <fd4/resource.hpp>
16#include <memory/from_set.hpp>
19#include <param/detail/paramdef.hpp>
20#include <param/param_file.hpp>
21
22namespace from {
23namespace CS {
33public:
34 FD4_RUNTIME_CLASS(ParamResCap);
35
42 if (!this->underlying)
43 return std::nullopt;
44 auto& param_file = this->underlying->get_param_file();
45 if (!param_file)
46 return std::nullopt;
47 return param_file;
48 }
49
50private:
51 long long liber_unknown;
52 FD4::FD4ParamResCap* underlying;
53};
54
62public:
63 FD4_SINGLETON_CLASS(SoloParamRepository);
64
65 virtual ~SoloParamRepository() LIBER_INTERFACE_ONLY;
66
81 LIBERAPI static bool wait_for_params(int timeout);
82
90 auto res_cap = this->param_entries[int(index)].res_cap[0];
91 if (!res_cap)
92 return std::nullopt;
93 return res_cap->get_param_file();
94 }
95
96private:
97 void* liber_unknown;
98 struct {
99 int res_cap_count;
100 ParamResCap* res_cap[8];
101 } param_entries[int(param::param_index::PARAM_COUNT)];
102 struct CSWepReinforceTree {
103 virtual ~CSWepReinforceTree() = default;
105 void* liber_unknown;
106 } wep_reinforce_tree;
109 from::set<int> liber_unknown;
110 from::set<int> liber_unknown;
111 from::set<int> liber_unknown;
112 from::set<int> liber_unknown;
113};
114
115LIBER_ASSERTS_BEGIN(SoloParamRepository);
116LIBER_ASSERT_SIZE(0x37C8);
117LIBER_ASSERTS_END;
118}; // namespace CS
119}; // namespace from
A resource capsule containing a param table capsule.
Definition cs_param.hpp:32
liber::optref< param::param_file * > get_param_file()
Get the param file associated with this capsule.
Definition cs_param.hpp:41
A singleton responsible for storing param resource capsules.
Definition cs_param.hpp:61
static LIBERAPI bool wait_for_params(int timeout)
Lock until the param repository is loaded or the time runs out.
liber::optref< param::param_file * > get_param_file(param::param_index index)
Get the raw param file at the associated param index.
Definition cs_param.hpp:89
A resource capsule containing a param table file.
Definition fd4_param.hpp:19
param::param_file *& get_param_file() noexcept
Get a pointer to the underlying param file.
Definition fd4_param.hpp:28
The base of any resource, which can also be a file or a repository.
Definition resource.hpp:120
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:310
Namespace FD4 param resources.
ELDEN RING allocation interface and from::allocator.
from::set based on std::set
std::set< T, Pred, from::allocator< T, AllocatorTag > > set
std::set with from::allocator.
Definition from_set.hpp:24
from::basic_string based on std::basic_string
from::vector based on std::vector
std::vector< T, from::allocator< T, AllocatorTag > > vector
std::vector with from::allocator.
Definition from_vector.hpp:23
Optional references based on std::optional.
param_index
An enum of all param tables as they appear in order.
Definition param_defines.hpp:56
ELDEN RING param file layouts.
FD4_SINGLETON_CLASS implementation.
A std::optional<std::reference_wrapper<T>> wrapper for lvalue references.
Definition optref.hpp:31