Mark Entity methods as readonly (#5919)

* Mark Entity methods as readonly

* Add to GenericEntityPrint

* No but really
This commit is contained in:
Tayrtahn
2025-05-15 06:23:29 -04:00
committed by GitHub
parent 3d8a9a41fa
commit 5c97b15849
2 changed files with 36 additions and 36 deletions

View File

@@ -179,7 +179,7 @@ public sealed class GenericEntityPrint
{
public EntityUid Owner;
{{fields.ToString().TrimEnd()}}
EntityUid IFluentEntityUid.FluentOwner => Owner;
readonly EntityUid IFluentEntityUid.FluentOwner => Owner;
public Entity(EntityUid owner{{parameters}})
{
@@ -212,9 +212,9 @@ public sealed class GenericEntityPrint
}
{{castRegion}}
public override int GetHashCode() => Owner.GetHashCode();
public Entity<{{nullableGenerics}}> AsNullable() => new(Owner{{selfAccess}});
public EntityUid AsType() => Owner;
public override readonly int GetHashCode() => Owner.GetHashCode();
public readonly Entity<{{nullableGenerics}}> AsNullable() => new(Owner{{selfAccess}});
public readonly EntityUid AsType() => Owner;
}