Skip to content

Commit 639ed77

Browse files
committed
Add Save/Load documentation
1 parent 67e5871 commit 639ed77

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

FancadeLoaderLib/Partial/PartialPrefabList.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public ushort IdOffset
112112

113113
public IEnumerable<PartialPrefabSegment> Segments => _segments;
114114

115+
/// <summary>
116+
/// Loads a <see cref="PartialPrefabList"/> from a <see cref="FcBinaryReader"/>.
117+
/// </summary>
118+
/// <param name="reader">The reader to read the <see cref="PartialPrefabList"/> from.</param>
119+
/// <returns>A <see cref="PartialPrefabList"/> read from <paramref name="reader"/>.</returns>
115120
public static PartialPrefabList Load(FcBinaryReader reader)
116121
{
117122
if (reader is null)
@@ -157,6 +162,10 @@ public static PartialPrefabList Load(FcBinaryReader reader)
157162
return new PartialPrefabList(prefabs, idOffset);
158163
}
159164

165+
/// <summary>
166+
/// Writes a <see cref="PartialPrefabList"/> into a <see cref="FcBinaryWriter"/>.
167+
/// </summary>
168+
/// <param name="writer">The <see cref="FcBinaryWriter"/> to write this instance into.</param>
160169
public void Save(FcBinaryWriter writer)
161170
{
162171
if (writer is null)

FancadeLoaderLib/PrefabList.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ public ushort IdOffset
110110

111111
public IEnumerable<PrefabSegment> Segments => _segments;
112112

113+
/// <summary>
114+
/// Loads a <see cref="PrefabList"/> from a <see cref="FcBinaryReader"/>.
115+
/// </summary>
116+
/// <param name="reader">The reader to read the <see cref="PrefabList"/> from.</param>
117+
/// <returns>A <see cref="PrefabList"/> read from <paramref name="reader"/>.</returns>
113118
public static PrefabList Load(FcBinaryReader reader)
114119
{
115120
if (reader is null)
@@ -155,6 +160,10 @@ public static PrefabList Load(FcBinaryReader reader)
155160
return new PrefabList(prefabs, idOffset);
156161
}
157162

163+
/// <summary>
164+
/// Writes a <see cref="PrefabList"/> into a <see cref="FcBinaryWriter"/>.
165+
/// </summary>
166+
/// <param name="writer">The <see cref="FcBinaryWriter"/> to write this instance into.</param>
158167
public void Save(FcBinaryWriter writer)
159168
{
160169
if (writer is null)

FancadeLoaderLib/Raw/RawGame.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ public static (ushort FileVersion, string Name, string Author, string Descriptio
137137
}
138138

139139
/// <summary>
140-
/// Loads a game from a compressed stream.
140+
/// Loads a <see cref="RawGame"/> from a zlib compressed <see cref="Stream"/>.
141141
/// </summary>
142-
/// <param name="stream">The stream to load from.</param>
143-
/// <returns>The loaded game.</returns>
142+
/// <param name="stream">The reader to read the <see cref="RawGame"/> from.</param>
143+
/// <returns>A <see cref="RawGame"/> read from <paramref name="stream"/>.</returns>
144144
public static RawGame LoadCompressed(Stream stream)
145145
{
146146
// decompress
@@ -155,10 +155,10 @@ public static RawGame LoadCompressed(Stream stream)
155155
}
156156

157157
/// <summary>
158-
/// Loads a game from a reader.
158+
/// Loads a <see cref="RawGame"/> from a <see cref="FcBinaryReader"/>.
159159
/// </summary>
160-
/// <param name="reader">The reader to load from.</param>
161-
/// <returns>The loaded game.</returns>
160+
/// <param name="reader">The reader to read the <see cref="RawGame"/> from.</param>
161+
/// <returns>A <see cref="RawGame"/> read from <paramref name="reader"/>.</returns>
162162
public static RawGame Load(FcBinaryReader reader)
163163
{
164164
if (reader is null)
@@ -195,9 +195,9 @@ public static RawGame Load(FcBinaryReader reader)
195195
}
196196

197197
/// <summary>
198-
/// Saves and compresses game to a stream.
198+
/// Writes and compresses a <see cref="RawPrefab"/> into a <see cref="Stream"/>.
199199
/// </summary>
200-
/// <param name="stream">The stream to save to.</param>
200+
/// <param name="stream">The <see cref="Stream"/> to write this instance into.</param>
201201
public void SaveCompressed(Stream stream)
202202
{
203203
using (MemoryStream writerStream = new MemoryStream())
@@ -211,9 +211,9 @@ public void SaveCompressed(Stream stream)
211211
}
212212

213213
/// <summary>
214-
/// Saves a game to a writer.
214+
/// Writes a <see cref="RawPrefab"/> into a <see cref="FcBinaryWriter"/>.
215215
/// </summary>
216-
/// <param name="writer">The writer to save to.</param>
216+
/// <param name="writer">The <see cref="FcBinaryWriter"/> to write this instance into.</param>
217217
public void Save(FcBinaryWriter writer)
218218
{
219219
if (writer is null)

0 commit comments

Comments
 (0)