Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -634,11 +634,11 @@ sealed class Explosion
foreach (var grid in gridData)
{
_explosionData.Add(new()
_explosionData.Add(new ExplosionData
{
TileLists = grid.TileLists,
Lookup = entMan.GetComponent<BroadphaseComponent>(((Component) grid.Grid).Owner),
MapGrid = grid.Grid
Lookup = entMan.GetComponent<BroadphaseComponent>(grid.Grid.Owner),
MapGrid = grid.Grid,
});
}

View File

@@ -153,7 +153,7 @@ public sealed partial class ExplosionSystem : EntitySystem
if (tilesInIteration[i] * intensityIncrease >= remainingIntensity)
{
// there is not enough intensity left to distribute. add a fractional amount and break.
iterationIntensity[i] += (float) remainingIntensity / tilesInIteration[i];
iterationIntensity[i] += remainingIntensity / tilesInIteration[i];
remainingIntensity = 0;
break;
}
@@ -219,7 +219,7 @@ public sealed partial class ExplosionSystem : EntitySystem
tilesInIteration.Add(newTileCount);
if (newTileCount * stepSize >= remainingIntensity)
{
iterationIntensity.Add((float) remainingIntensity / newTileCount);
iterationIntensity.Add(remainingIntensity / newTileCount);
break;
}

View File

@@ -44,7 +44,7 @@ public abstract class ExplosionTileFlood
{
var freeDirections = ignoreLocalBlocker ? AtmosDirection.All : GetUnblockedDirectionOrAll(tile);
// Get the free directions of the directly adjacent tiles
// Get the free directions of the directly adjacent tiles
var freeDirectionsN = GetUnblockedDirectionOrAll(tile.Offset(AtmosDirection.North));
var freeDirectionsE = GetUnblockedDirectionOrAll(tile.Offset(AtmosDirection.East));
var freeDirectionsS = GetUnblockedDirectionOrAll(tile.Offset(AtmosDirection.South));
@@ -123,7 +123,7 @@ public abstract class ExplosionTileFlood
/// This is a data structure can be used to ensure the uniqueness of Vector2i indices.
/// </summary>
/// <remarks>
/// This basically exists to replace the use of HashSet<Vector2i> if all you need is the the functions Contains()
/// This basically exists to replace the use of HashSet&lt;Vector2i&gt; if all you need is the the functions Contains()
/// and Add(). This is both faster and apparently allocates less. Does not support iterating over contents
/// </remarks>
public sealed class UniqueVector2iSet