Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<Vector2i> 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
|
||||
|
||||
Reference in New Issue
Block a user