Vixen
c7401864
csharp
public sealed class PlayerGroup

A party, a squad or a team: the volatile membership and everything that changes it.

Read the guide page for this →

Remarks

Volatile, and doc 28 says the durable copy is a grain — party and squad state outlives any one shard and drives doc 27's placement. This is the logic; keeping it is ISocialStore's, for the same reason IPityStore exists.

⚠ A non-empty group always has exactly one leader, and that is the invariant everything else is arranged around. A leaderless group cannot invite, cannot kick and cannot be disbanded — it is a group that has to be cleaned up by an operator. So leadership passes on a leader leaving or being removed, and it passes to the longest-standing remaining member rather than to whoever a dictionary enumerated first: the rule has to be one a client can predict and two servers agree on.

Fields and properties (7)

  • public GroupId Id

    Its id.

  • public GroupPolicy Policy

    How big it is and who may do what.

  • public PlayerId Leader

    Who leads it, or None when it is empty.

  • public IReadOnlyList<GroupMember> Members

    Its members, in the order they joined.

  • public int Count

    How many are in it.

  • public bool IsEmpty

    Whether nobody is left.

  • public IReadOnlyList<GroupInvite> Invites

    The invites standing right now.

Events (1)

  • public Action<PlayerGroup>? Changed

    Raised whenever the membership changes.

Methods (14)

Used by (1)

  • GroupTestsVixen.Gameplay.Social.Tests