Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 9 forward compatibility changes #33421

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Content.Server/Announcements/AnnounceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
}
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!");
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Cargo/Systems/PricingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/NPC/Pathfinding/PathfindingSystem.Breadth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public record struct SplinePathResult()
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ public record struct WidenArgs()

public float MaxWiden = 7f;

public List<Vector2i> Path;
public required List<Vector2i> Path;
}
}
2 changes: 1 addition & 1 deletion Content.Shared/Forensics/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ public record struct GenerateDnaEvent()
/// <summary>
/// The generated DNA.
/// </summary>
public string DNA;
public required string DNA;
}
11 changes: 6 additions & 5 deletions Content.Shared/Silicons/StationAi/StationAiVisionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public override void Initialize()
EntManager = EntityManager,
Maps = _maps,
System = this,
VisibleTiles = _singleTiles,
};
}

Expand Down Expand Up @@ -278,7 +279,7 @@ private bool IsCorner(
/// </summary>
private record struct SeedJob() : IRobustJob
{
public StationAiVisionSystem System;
public required StationAiVisionSystem System;

public Entity<MapGridComponent> Grid;
public Box2 ExpandedBounds;
Expand All @@ -293,14 +294,14 @@ private record struct ViewJob() : IParallelRobustJob
{
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();
Expand Down
Loading