Skip to content

Commit 78233ad

Browse files
author
LoneWandererProductions
committed
Header comments standardized, MapChangeResult moved
In several source files, the header comments have been updated and the file path standardized. The XML documentation in Helper.cs has been improved and the class changed to partial. The record struct MapChangeResult has been moved from Helper.cs to its own file. In Polaris.xaml.cs, the XML comments for properties have been consistently adjusted.
1 parent ed4ab8f commit 78233ad

9 files changed

Lines changed: 62 additions & 31 deletions

File tree

0 Bytes
Loading
0 Bytes
Loading

Solaris/Aurora.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Aurora.cs
4+
* FILE: Aurora.cs
55
* PURPOSE: Game Control
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/

Solaris/Box.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Box.cs
4+
* FILE: Box.cs
55
* PURPOSE: Helper Object to handle the drawing and processing Process
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
@@ -22,7 +22,7 @@ internal sealed class Box
2222
/// <value>
2323
/// The image.
2424
/// </value>
25-
internal Bitmap Image { get; init; }
25+
internal Bitmap? Image { get; init; }
2626

2727
/// <summary>
2828
/// Gets the x.

Solaris/Helper.cs

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Helper.cs
4+
* FILE: Helper.cs
55
* PURPOSE: Helper class for image processing and map rendering.
66
* PROGRAMMER: Peter Geinitz (Wayfarer)
77
*/
@@ -21,7 +21,7 @@ namespace Solaris;
2121
/// <summary>
2222
/// Helper class that manages image generation tasks.
2323
/// </summary>
24-
internal static class Helper
24+
internal static partial class Helper
2525
{
2626
/// <summary>
2727
/// The render
@@ -41,7 +41,7 @@ internal static class Helper
4141
/// <param name="textureSize">Size of the texture.</param>
4242
/// <param name="textures">The textures.</param>
4343
/// <param name="map">The map.</param>
44-
/// <returns></returns>
44+
/// <returns>Generated Board as Imaage</returns>
4545
internal static Bitmap GenerateImage(
4646
int width, int height, int textureSize,
4747
Dictionary<int, Texture> textures,
@@ -117,7 +117,7 @@ internal static ImageSource GenerateGrid(int width, int height, int textureSize)
117117
/// <param name="height">The height.</param>
118118
/// <param name="textureSize">Size of the texture.</param>
119119
/// <param name="padding">The padding.</param>
120-
/// <returns></returns>
120+
/// <returns>Image with Numbers overlayed.</returns>
121121
internal static ImageSource GenerateNumbers(int width, int height, int textureSize, int padding = 2)
122122
{
123123
using var bitmap = new Bitmap(width * textureSize, height * textureSize);
@@ -147,7 +147,7 @@ internal static ImageSource GenerateNumbers(int width, int height, int textureSi
147147
/// </summary>
148148
/// <param name="map">The map.</param>
149149
/// <param name="idTexture">The identifier texture.</param>
150-
/// <returns></returns>
150+
/// <returns>Generate a new Bitmap for the new Map</returns>
151151
internal static MapChangeResult AddTile(
152152
Dictionary<int, List<int>>? map, KeyValuePair<int, int> idTexture)
153153
{
@@ -163,7 +163,7 @@ internal static MapChangeResult AddTile(
163163
/// <param name="map">The map.</param>
164164
/// <param name="textures">The textures.</param>
165165
/// <param name="idLayer">The identifier layer.</param>
166-
/// <returns></returns>
166+
/// <returns>Remove a Tile from the map.</returns>
167167
internal static MapChangeResult RemoveTile(
168168
Dictionary<int, List<int>>? map, Dictionary<int, Texture> textures, KeyValuePair<int, int> idLayer)
169169
{
@@ -201,7 +201,7 @@ internal static MapChangeResult RemoveTile(
201201
/// <param name="textures">The textures.</param>
202202
/// <param name="layer">The layer.</param>
203203
/// <param name="idTile">The identifier tile.</param>
204-
/// <returns></returns>
204+
/// <returns>Add an Image to the image Layer</returns>
205205
public static Bitmap? AddDisplay(
206206
int width, int textureSize, Dictionary<int, Texture> textures, Bitmap? layer,
207207
KeyValuePair<int, int> idTile)
@@ -215,8 +215,13 @@ internal static MapChangeResult RemoveTile(
215215
}
216216

217217
/// <summary>
218-
/// Removes a tile image from the display layer.
218+
/// Removes a tile image from the display layer.
219219
/// </summary>
220+
/// <param name="width">The width.</param>
221+
/// <param name="textureSize">Size of the texture.</param>
222+
/// <param name="layer">The layer.</param>
223+
/// <param name="position">The position.</param>
224+
/// <returns>Remove areal from Image</returns>
220225
public static Bitmap RemoveDisplay(int width, int textureSize, Bitmap? layer, int position)
221226
{
222227
var x = position % width * textureSize;
@@ -226,8 +231,15 @@ public static Bitmap RemoveDisplay(int width, int textureSize, Bitmap? layer, in
226231
}
227232

228233
/// <summary>
229-
/// Displays movement animation.
234+
/// Displays movement animation.
230235
/// </summary>
236+
/// <param name="aurora">The aurora.</param>
237+
/// <param name="steps">The steps.</param>
238+
/// <param name="avatar">The avatar.</param>
239+
/// <param name="width">The width.</param>
240+
/// <param name="height">The height.</param>
241+
/// <param name="textureSize">Size of the texture.</param>
242+
/// <returns>Status of the animation.</returns>
231243
internal static async Task DisplayMovement(Aurora aurora, IEnumerable<int> steps, Bitmap? avatar,
232244
int width, int height, int textureSize)
233245
{
@@ -247,18 +259,18 @@ internal static async Task DisplayMovement(Aurora aurora, IEnumerable<int> steps
247259
}
248260

249261
/// <summary>
250-
/// Moves the avatar to a new position with animation.
262+
/// Moves the avatar to a new position with animation.
251263
/// </summary>
264+
/// <param name="x">The x.</param>
265+
/// <param name="y">The y.</param>
266+
/// <param name="background">The background.</param>
267+
/// <param name="avatar">The avatar.</param>
268+
/// <param name="sleep">The sleep.</param>
269+
/// <returns>Status of the animation.</returns>
252270
private static async Task<bool> MoveAvatar(int x, int y, Bitmap? background, Bitmap? avatar, int sleep)
253271
{
254272
Render.CombineBitmap(background, avatar, x, y);
255273
await Task.Delay(sleep);
256274
return true;
257275
}
258-
259-
/// <inheritdoc />
260-
/// <summary>
261-
/// Return type for map manipulation methods.
262-
/// </summary>
263-
internal readonly record struct MapChangeResult(bool Changed, Dictionary<int, List<int>>? Map);
264276
}

Solaris/MapChangeResult.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* COPYRIGHT: See COPYING in the top level directory
3+
* PROJECT: Solaris
4+
* FILE: MapChangeResult.cs
5+
* PURPOSE: Record that holds the result of a map change operation.
6+
* PROGRAMMER: Peter Geinitz (Wayfarer)
7+
*/
8+
9+
using System.Collections.Generic;
10+
11+
namespace Solaris
12+
{
13+
14+
/// <inheritdoc />
15+
/// <summary>
16+
/// Return type for map manipulation methods.
17+
/// </summary>
18+
internal readonly record struct MapChangeResult(bool Changed, Dictionary<int, List<int>>? Map);
19+
}

Solaris/Polaris.xaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Polaris.cs
4+
* FILE: Polaris.cs
55
* PURPOSE: Editor Control
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
@@ -161,10 +161,10 @@ public Polaris()
161161
internal Bitmap? BitmapLayerOne { get; private set; }
162162

163163
/// <summary>
164-
/// Gets or sets the height of the polaris.
164+
/// Gets or sets the height of the Polaris.
165165
/// </summary>
166166
/// <value>
167-
/// The height of the polaris.
167+
/// The height of the Polaris.
168168
/// </value>
169169
public int PolarisHeight
170170
{
@@ -173,10 +173,10 @@ public int PolarisHeight
173173
}
174174

175175
/// <summary>
176-
/// Gets or sets the width of the polaris.
176+
/// Gets or sets the width of the Polaris.
177177
/// </summary>
178178
/// <value>
179-
/// The width of the polaris.
179+
/// The width of the Polaris.
180180
/// </value>
181181
public int PolarisWidth
182182
{
@@ -185,10 +185,10 @@ public int PolarisWidth
185185
}
186186

187187
/// <summary>
188-
/// Gets or sets the size of the polaris texture.
188+
/// Gets or sets the size of the Polaris texture.
189189
/// </summary>
190190
/// <value>
191-
/// The size of the polaris texture.
191+
/// The size of the Polaris texture.
192192
/// </value>
193193
public int PolarisTextureSize
194194
{
@@ -197,10 +197,10 @@ public int PolarisTextureSize
197197
}
198198

199199
/// <summary>
200-
/// Gets or sets the polaris map.
200+
/// Gets or sets the Polaris map.
201201
/// </summary>
202202
/// <value>
203-
/// The polaris map.
203+
/// The Polaris map.
204204
/// </value>
205205
public Dictionary<int, List<int>>? PolarisMap
206206
{

Solaris/Resources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Resources.cs
4+
* FILE: Resources.cs
55
* PURPOSE: Some basic string Resources
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/

Solaris/Texture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
33
* PROJECT: Solaris
4-
* FILE: Solaris/Aurora.cs
4+
* FILE: Aurora.cs
55
* PURPOSE: Texture object
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
@@ -25,7 +25,7 @@ public sealed class Texture
2525
/// <value>
2626
/// The path.
2727
/// </value>
28-
public string Path { get; init; }
28+
public string? Path { get; init; }
2929

3030
/// <summary>
3131
/// Gets the layer.

0 commit comments

Comments
 (0)