载入中...
搜索中...
未找到
HouseComponentLibrary.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6#include "common/Result.h"
8
9#include <functional>
10#include <string>
11#include <string_view>
12#include <unordered_map>
13#include <vector>
14
15namespace eve::housegen {
16
19public:
21 [[nodiscard]] eve::Result<void> loadFromJson(std::string_view json);
22 [[nodiscard]] eve::Result<void> loadFromFile(std::string_view filename);
24 [[nodiscard]] eve::Result<void> registerComponent(const HouseComponent &component);
26 void clear();
28 [[nodiscard]] eve::OptionalRef<const HouseComponent> find(std::string_view id) const;
30 std::vector<std::string> ids() const;
32 [[nodiscard]] std::vector<std::reference_wrapper<const HouseComponent>> byCategory(
33 std::string_view category, std::string_view style = {}) const;
40 [[nodiscard]] bool hasCompletePack(std::string_view style) const;
42 [[nodiscard]] std::vector<std::string> completePacks() const;
44 int count() const;
45
46private:
47 std::unordered_map<std::string, HouseComponent> components_;
48};
49
50} // namespace eve::housegen
Vocabulary aliases for nullable and checked borrowed references.
#define EVENGINE_API_DOMAINS
Definition Export.h:110
glm::uvec4 ids
Move-only, checked operation results for the common layer.
std::uint32_t count
const char * category
Move-only operation result carrying either a value or Status.
Definition Result.h:155
房屋组件注册表(按 id 索引,支持分类/风格查询)。
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
房屋组件模板(几何 + 连接点 + 权重)。