66namespace Engine3DRadSpace ::Content
77{
88 // / <summary>
9- // /
9+ // / Manages the lifetimes of all loaded assets.
1010 // / </summary>
1111 class E3DRSP_CONTENT_EXPORT ContentManager : public IService
1212 {
@@ -123,6 +123,10 @@ namespace Engine3DRadSpace::Content
123123 std::vector<AssetEntry> _assets;
124124 IGame* _owner;
125125 public:
126+ // / <summary>
127+ // / Constructs an instance of ContentManager.
128+ // / </summary>
129+ // / <param name="owner">Owner of this ContentManager.</param>
126130 ContentManager (IGame* owner);
127131
128132 ContentManager (const ContentManager &) = delete;
@@ -131,33 +135,102 @@ namespace Engine3DRadSpace::Content
131135 ContentManager &operator =(const ContentManager &) = delete;
132136 ContentManager &operator =(ContentManager &&) noexcept = default ;
133137
138+ // / <summary>
139+ // / Registers an type T into this ContentManager.
140+ // / </summary>
141+ // / <typeparam name="T">Type that must satisfy the AssetType concept</typeparam>
142+ // / <param name="dummy">Type dummy used for operator overloading</param>
134143 template <AssetType T>
135144 void RegisterType (Tag<T> dummy);
136145
146+ // / <summary>
147+ // / Loads an asset of type T from the specified path.
148+ // / </summary>
149+ // / <typeparam name="T">Asset type.</typeparam>
150+ // / <param name="path">Path on disk to the asset.</param>
151+ // / <param name="refID">Optional reference ID to store the asset's ID.</param>
152+ // / <returns>Pointer to the loaded asset.</returns>
137153 template <AssetType T>
138154 T* Load (const std::filesystem::path& path, AssetID<T>* refID = nullptr );
139155
156+ // / <summary>
157+ // / Loads an asset of type T with additional constructor parameters.
158+ // / </summary>
159+ // / <typeparam name="...Args">Extra type arguments</typeparam>
160+ // / <typeparam name="T">Asset type</typeparam>
161+ // / <param name="path">Path on disk to the asset.</param>
162+ // / <param name="refID">Optional reference ID to store the asset's ID.</param>
163+ // / <param name="...params">Additional constructor parameters.</param>
164+ // / <returns>Pointer to the loaded asset.</returns>
140165 template <AssetType T, typename ...Args>
141166 T* Load (const std::filesystem::path& path, AssetID<T>* refID, Args&& ...params);
142167
168+ // / <summary>
169+ // / Type erased asset loading function.
170+ // / </summary>
171+ // / <param name="uuid">UUID of the asset type.</param>
172+ // / <param name="path">Path on disk to the asset.</param>
173+ // / <param name="refID">Optional reference ID to store the asset's ID.</param>
174+ // / <returns>Pointer to the loaded asset.</returns>
143175 IAsset* Load (const Reflection::UUID &uuid, const std::filesystem::path& path, unsigned * refID = nullptr );
144176
177+ // / <summary>
178+ // / Reloads an asset by its reference ID.
179+ // / </summary>
180+ // / <param name="ref">Asset reference ID</param>
145181 void Reload (unsigned ref);
146182
183+ // / <summary>
184+ // / Returns an pointer to the asset of type T associated with the given reference ID.
185+ // / </summary>
186+ // / <typeparam name="T">Asset type</typeparam>
187+ // / <param name="ref">Asset reference ID</param>
188+ // / <returns>Pointer to the asset of type T</returns>
147189 template <AssetType T>
148190 T *operator [](AssetID<T> ref);
149191
192+ // / <summary>
193+ // / Returns the path an asset with the specified ID was loaded from.
194+ // / </summary>
195+ // / <param name="id">Asset ID</param>
196+ // / <returns>Path to the asset</returns>
150197 std::filesystem::path GetAssetPath (unsigned id) const noexcept ;
198+ // / <summary>
199+ // / Returns the type UUID of the specified asset ID.
200+ // / </summary>
201+ // / <param name="id">Asset ID</param>
202+ // / <returns>Type UUID of the asset</returns>
151203 Reflection::UUID GetAssetType (unsigned id) const noexcept ;
204+
205+ // / <summary>
206+ // / Returns the name of the specified asset ID.
207+ // / </summary>
208+ // / <param name="id">Asset ID</param>
209+ // / <returns>Name of the asset</returns>
152210 std::string GetAssetName (unsigned id) const noexcept ;
153211
154212 std::vector<AssetEntry>::iterator begin ();
155213 std::vector<AssetEntry>::iterator end ();
156214
215+ // / <summary>
216+ // / Frees an asset from the ContentManager by its ID.
217+ // / </summary>
218+ // / <param name="id">Asset ID</param>
157219 void RemoveAsset (unsigned id);
220+ // / <summary>
221+ // / Removes all assets from the ContentManager.
222+ // / </summary>
158223 void Clear ();
159224
225+ // / <summary>
226+ // / Returns the graphics device associated with this ContentManager.
227+ // / </summary>
228+ // / <returns>Pointer to the graphics device</returns>
160229 Graphics::IGraphicsDevice* GetDevice () const noexcept ;
230+ // / <summary>
231+ // / Returns the number of loaded assets in the ContentManager.
232+ // / </summary>
233+ // / <returns>Number of loaded assets</returns>
161234 size_t Count () const noexcept ;
162235
163236 ~ContentManager () override = default ;
0 commit comments