Document GridSet, fix resource hot reload on every frame.

This commit is contained in:
2025-11-15 17:20:22 +01:00
parent 828ec4973f
commit 11423d86e5
3 changed files with 18 additions and 10 deletions

View File

@@ -115,7 +115,7 @@ public class TestGame : Game
{
if (Input.IsActionPressed("reload"))
{
ResourceManager.Reload();
// ResourceManager.Reload();
// _particleSystem!.RestartEmitter(_emitterId);
}
}

View File

@@ -7,15 +7,23 @@ namespace Voile;
public class GridSet<T>
{
public float GridSize { get; }
public GridSet(float gridSize = 32.0f)
/// <summary>
/// The size of a cell of this <see cref="GridSet"/>.
/// </summary>
public float CellSize { get; }
public GridSet(float cellSize = 32.0f)
{
GridSize = gridSize;
CellSize = cellSize;
}
/// <summary>
/// Add an element to this <see cref="GridSet"/>.
/// </summary>
/// <param name="position">Position of the element in this <see cref="GridSet"/>.</param>
/// <param name="child">Element to add.</param>
public void Add(Vector2 position, T child)
{
var snap = Vector2.One * GridSize;
var snap = Vector2.One * CellSize;
position = position.Snapped(snap);
if (_values.TryGetValue(position, out var list))
@@ -28,10 +36,11 @@ public class GridSet<T>
}
}
public void Remove(T child)
{
}
/// <summary>
/// Removes an element from this <see cref="GridSet"/>.
/// </summary>
/// <param name="child">Element to remove.</param>
public void Remove(T child) => throw new NotImplementedException();
private Dictionary<Vector2, List<T>> _values = new();
}

View File

@@ -269,7 +269,6 @@ namespace Voile.Resources
| NotifyFilters.CreationTime
| NotifyFilters.DirectoryName
| NotifyFilters.FileName
| NotifyFilters.LastAccess
| NotifyFilters.LastWrite
| NotifyFilters.Security
| NotifyFilters.Size;