public sealed class GuildA guild: a roster, a ladder, and a permission matrix that is a tag query per action.
Remarks
Durable state, and doc 28 says it lives in a grain — IGuildGrain, which doc 27 explicitly hands to this document. What is here is the rules; keeping it is ISocialStore's.
⚠ A guild always has exactly one member at rank zero. Every operation that could remove the last one is refused with WouldStrand: a guild whose leader left, demoted themselves or was somehow removed is a guild that cannot invite, cannot promote and cannot be disbanded, and the only fix is an operator with database access. The leader has to hand it over first, which is one extra click and no support tickets.
⚠ Nobody may act on somebody at or above their own rank. Without it an officer can kick the leader, and every guild in the game is one disgruntled officer from being emptied.
Fields and properties (7)
public GuildId IdIts id.
public string NameWhat it is called.
public GuildCharter CharterWhat it started as.
public IReadOnlyList<GuildRank> RanksIts ladder, highest first.
public IReadOnlyDictionary<PlayerId, int> RosterIts roster, as a player and the index of their rank.
public int CountHow many are in it.
public PlayerId LeaderWho runs it, or None for a guild with nobody left.
Methods (10)
public Guild(GuildCharter charter, PlayerId founder, string name = "", GuildId id = default(GuildId))Founds a guild.
public int RankOf(PlayerId player)What rank somebody holds.
public bool Can(PlayerId player, GameplayTagRange permission)Whether somebody may do something.
public GuildRefusal Add(PlayerId by, PlayerId player, GameplayTagRange invitePermission = default(GameplayTagRange))Adds somebody at the bottom rung.
public GuildRefusal Remove(PlayerId by, PlayerId player, GameplayTagRange kickPermission = default(GameplayTagRange))Removes somebody.
public GuildRefusal SetRank(PlayerId by, PlayerId player, int rank)Moves somebody to another rung.
public bool Seat(PlayerId player, int rank)Puts somebody on a rung with no checks at all.
public bool Unseat(PlayerId player)Takes somebody off the roster with no checks at all. The authority's, like Seat.
public bool RenameRank(int rank, string name)Renames a rung.
public IEnumerable<PlayerId> At(int rank)Everybody at a rung.
Used by (6)
- GuildTestsVixen.Gameplay.Social.Tests
- ISocialStoreVixen.Gameplay.Social
- MemorySocialStoreVixen.Gameplay.Social
- SocialBridgeVixen.Live.Gameplay
- SocialBridgeTestsVixen.Live.Gameplay.Tests
- SocialLibraryTestsVixen.Gameplay.Social.Tests