mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
refactor: change pointer parameters to references for Level and Content in various classes
This commit is contained in:
parent
ef2c0b2370
commit
c1b311f3c4
41 changed files with 258 additions and 251 deletions
|
|
@ -159,9 +159,9 @@ std::optional<WorldInfo> WorldFiles::readWorldInfo() {
|
|||
}
|
||||
|
||||
static void read_resources_data(
|
||||
const Content* content, const dv::value& list, ResourceType type
|
||||
const Content& content, const dv::value& list, ResourceType type
|
||||
) {
|
||||
const auto& indices = content->getIndices(type);
|
||||
const auto& indices = content.getIndices(type);
|
||||
for (size_t i = 0; i < list.size(); i++) {
|
||||
auto& map = list[i];
|
||||
const auto& name = map["name"].asString();
|
||||
|
|
@ -174,7 +174,7 @@ static void read_resources_data(
|
|||
}
|
||||
}
|
||||
|
||||
bool WorldFiles::readResourcesData(const Content* content) {
|
||||
bool WorldFiles::readResourcesData(const Content& content) {
|
||||
fs::path file = getResourcesFile();
|
||||
if (!fs::is_regular_file(file)) {
|
||||
logger.warning() << "resources.json does not exists";
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
void createDirectories();
|
||||
|
||||
std::optional<WorldInfo> readWorldInfo();
|
||||
bool readResourcesData(const Content* content);
|
||||
bool readResourcesData(const Content& content);
|
||||
|
||||
static void createContentIndicesCache(
|
||||
const ContentIndices* indices, dv::value& root
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue