Skip to content

Commit

Permalink
Make Rectangle a readonly struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Oct 31, 2023
1 parent 80c3973 commit 2434e52
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions OpenRA.Game/Primitives/Rectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

namespace OpenRA.Primitives
{
public struct Rectangle : IEquatable<Rectangle>
public readonly struct Rectangle : IEquatable<Rectangle>
{
// 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)
Expand Down

0 comments on commit 2434e52

Please sign in to comment.