Vixen
c7401864
csharp
public sealed class SocialGraph

One player's friends and blocks.

Read the guide page for this →

Remarks

Friendship is mutual and asked for; a block is one-way and silent. Those are two different relations and games that model them as one list with a flag end up letting somebody discover they have been blocked, which is the one thing a block has to avoid.

⚠ Blocking removes the friendship and cancels the pending requests, both ways. Otherwise the person just blocked is still on the friends list, still visible in presence, and still able to be re-invited by a UI that reads the list rather than asking.

Fields and properties (5)

  • public PlayerId Owner

    Whose it is.

  • public IReadOnlyCollection<PlayerId> Friends

    Their friends.

  • public IReadOnlyCollection<PlayerId> Blocked

    Who they have blocked.

  • public IReadOnlyCollection<PlayerId> Outgoing

    Requests they have sent and nobody has answered.

  • public IReadOnlyCollection<PlayerId> Incoming

    Requests waiting for them.

Methods (14)

  • public SocialGraph(PlayerId owner)

    Makes an empty graph for one player.

  • public bool IsFriend(PlayerId player)

    Whether somebody is a friend.

  • public bool HasBlocked(PlayerId player)

    Whether the owner has blocked somebody.

  • public bool IsBlockedBy(PlayerId player)

    Whether somebody has blocked the owner.

  • public bool Request(PlayerId player)

    Asks somebody to be a friend.

  • public bool Receive(PlayerId player)

    Records that somebody has asked.

  • public bool Accept(PlayerId player)

    Says yes to a request.

  • public bool Dismiss(PlayerId player)

    Says no, or withdraws one.

  • public bool Unfriend(PlayerId player)

    Stops being friends.

  • public bool Block(PlayerId player)

    Blocks somebody, which unfriends them and drops every request either way.

  • public bool Unblock(PlayerId player)

    Unblocks somebody. It does not put the friendship back.

  • public SocialTie TieTo(PlayerId player)

    What somebody is to the owner.

  • public bool Seat(PlayerId player, SocialTie tie)

    Puts a tie in with no checks at all.

  • public IEnumerable<KeyValuePair<PlayerId, SocialTie>> Ties()

    Everybody the owner has any tie to, in player order.

Used by (10)

  • GroupTestsVixen.Gameplay.Social.Tests
  • HousekeepingTestsVixen.Live.Gameplay.Tests
  • ISocialStoreVixen.Gameplay.Social
  • MemorySocialStoreVixen.Gameplay.Social
  • PlayerGroupVixen.Gameplay.Social
  • PresenceTestsVixen.Gameplay.Social.Tests
  • SocialBridgeVixen.Live.Gameplay
  • SocialBridgeTestsVixen.Live.Gameplay.Tests
  • SocialGraphTestsVixen.Gameplay.Social.Tests
  • SocialGraphsVixen.Gameplay.Social