Document GridSet, fix resource hot reload on every frame.
This commit is contained in:
@@ -115,7 +115,7 @@ public class TestGame : Game
|
||||
{
|
||||
if (Input.IsActionPressed("reload"))
|
||||
{
|
||||
ResourceManager.Reload();
|
||||
// ResourceManager.Reload();
|
||||
// _particleSystem!.RestartEmitter(_emitterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -269,7 +269,6 @@ namespace Voile.Resources
|
||||
| NotifyFilters.CreationTime
|
||||
| NotifyFilters.DirectoryName
|
||||
| NotifyFilters.FileName
|
||||
| NotifyFilters.LastAccess
|
||||
| NotifyFilters.LastWrite
|
||||
| NotifyFilters.Security
|
||||
| NotifyFilters.Size;
|
||||
|
||||
Reference in New Issue
Block a user