.NET 9 forward compatibility changes (#33421)
This doesn't switch the projects over to .NET 9, but it does make them work on .NET 9 when we decide to switch in the future.
This commit is contained in:
committed by
GitHub
parent
42ee90e53e
commit
c4e2eb9d02
@@ -28,7 +28,8 @@ namespace Content.Server.Announcements
|
||||
}
|
||||
else
|
||||
{
|
||||
var message = string.Join(' ', new ArraySegment<string>(args, 1, args.Length-1));
|
||||
// Explicit IEnumerable<string> due to overload ambiguity on .NET 9
|
||||
var message = string.Join(' ', (IEnumerable<string>)new ArraySegment<string>(args, 1, args.Length-1));
|
||||
chat.DispatchGlobalAnnouncement(message, args[0], colorOverride: Color.Gold);
|
||||
}
|
||||
shell.WriteLine("Sent!");
|
||||
|
||||
@@ -424,7 +424,7 @@ public record struct PriceCalculationEvent()
|
||||
[ByRefEvent]
|
||||
public record struct EstimatedPriceCalculationEvent()
|
||||
{
|
||||
public EntityPrototype Prototype;
|
||||
public required EntityPrototype Prototype;
|
||||
|
||||
/// <summary>
|
||||
/// The total price of the entity.
|
||||
|
||||
@@ -11,8 +11,8 @@ public sealed partial class PathfindingSystem
|
||||
/// </summary>
|
||||
public record struct BreadthPathArgs()
|
||||
{
|
||||
public Vector2i Start;
|
||||
public List<Vector2i> Ends;
|
||||
public required Vector2i Start;
|
||||
public required List<Vector2i> Ends;
|
||||
|
||||
public bool Diagonals = false;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public sealed partial class PathfindingSystem
|
||||
public List<Vector2i> Points = new();
|
||||
|
||||
public List<Vector2i> Path = new();
|
||||
public Dictionary<Vector2i, Vector2i> CameFrom;
|
||||
public Dictionary<Vector2i, Vector2i>? CameFrom;
|
||||
}
|
||||
|
||||
public record struct SplinePathArgs(SimplePathArgs Args)
|
||||
|
||||
@@ -84,6 +84,6 @@ public sealed partial class PathfindingSystem
|
||||
|
||||
public float MaxWiden = 7f;
|
||||
|
||||
public List<Vector2i> Path;
|
||||
public required List<Vector2i> Path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,5 +66,5 @@ public record struct GenerateDnaEvent()
|
||||
/// <summary>
|
||||
/// The generated DNA.
|
||||
/// </summary>
|
||||
public string DNA;
|
||||
public required string DNA;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public sealed class StationAiVisionSystem : EntitySystem
|
||||
EntManager = EntityManager,
|
||||
Maps = _maps,
|
||||
System = this,
|
||||
VisibleTiles = _singleTiles,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -278,7 +279,7 @@ public sealed class StationAiVisionSystem : EntitySystem
|
||||
/// </summary>
|
||||
private record struct SeedJob() : IRobustJob
|
||||
{
|
||||
public StationAiVisionSystem System;
|
||||
public required StationAiVisionSystem System;
|
||||
|
||||
public Entity<MapGridComponent> Grid;
|
||||
public Box2 ExpandedBounds;
|
||||
@@ -293,14 +294,14 @@ public sealed class StationAiVisionSystem : EntitySystem
|
||||
{
|
||||
public int BatchSize => 1;
|
||||
|
||||
public IEntityManager EntManager;
|
||||
public SharedMapSystem Maps;
|
||||
public StationAiVisionSystem System;
|
||||
public required IEntityManager EntManager;
|
||||
public required SharedMapSystem Maps;
|
||||
public required StationAiVisionSystem System;
|
||||
|
||||
public Entity<MapGridComponent> Grid;
|
||||
public List<Entity<StationAiVisionComponent>> Data = new();
|
||||
|
||||
public HashSet<Vector2i> VisibleTiles;
|
||||
public required HashSet<Vector2i> VisibleTiles;
|
||||
|
||||
public readonly List<Dictionary<Vector2i, int>> Vis1 = new();
|
||||
public readonly List<Dictionary<Vector2i, int>> Vis2 = new();
|
||||
|
||||
Reference in New Issue
Block a user