From 73be3641eac3dd934ad49e565e0d7ecd42c9ebde Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 31 Oct 2023 17:06:39 +0000 Subject: [PATCH] Make Rectangle a readonly struct. --- OpenRA.Game/Primitives/Rectangle.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/OpenRA.Game/Primitives/Rectangle.cs b/OpenRA.Game/Primitives/Rectangle.cs index 91a721feb6..8dc8c65a8f 100644 --- a/OpenRA.Game/Primitives/Rectangle.cs +++ b/OpenRA.Game/Primitives/Rectangle.cs @@ -13,13 +13,12 @@ using System; namespace OpenRA.Primitives { - public struct Rectangle : IEquatable + public readonly struct Rectangle : IEquatable { - // TODO: Make these readonly: this will require a lot of changes to the UI logic - public int X; - public int Y; - public int Width; - public int Height; + public readonly int X; + public readonly int Y; + public readonly int Width; + public readonly int Height; public static readonly Rectangle Empty; public static Rectangle FromLTRB(int left, int top, int right, int bottom)