refactor: unlink no longer needs a groupname arg

A claim can only belong to one claim link at a time, so it resolves
via the new Registry.FindLinkContaining(playerUid, claimIndex).
This commit is contained in:
2026-07-12 19:52:23 +02:00
parent 1803aaaa37
commit 4e97e25b38
2 changed files with 13 additions and 16 deletions
+5 -3
View File
@@ -44,14 +44,16 @@ public class ClaimLinkRegistry
Save();
}
public bool IsClaimLinked(string ownerPlayerUid, int localIndex)
public bool IsClaimLinked(string ownerPlayerUid, int localIndex) => FindLinkContaining(ownerPlayerUid, localIndex) != null;
public ClaimLink? FindLinkContaining(string ownerPlayerUid, int localIndex)
{
foreach (ClaimLink link in byGroupId.Values)
foreach (ClaimLinkMember member in link.Members)
if (member.OwnerPlayerUid == ownerPlayerUid && member.LocalClaimIndices.Contains(localIndex))
return true;
return link;
return false;
return null;
}
public void Save()