Client LuaCsForBarotrauma
FriendProvider.cs
1 #nullable enable
2 
3 using System.Collections.Immutable;
4 using System.Threading.Tasks;
6 
7 namespace Barotrauma
8 {
9  abstract class FriendProvider
10  {
11  public async Task<Option<FriendInfo>> RetrieveFriendWithAvatar(AccountId id, int size)
12  {
13  var friendOption = await RetrieveFriend(id);
14  if (!friendOption.TryUnwrap(out var friend)) { return Option.None; }
15 
16  friend.Avatar = await RetrieveAvatar(friend, size);
17  return Option.Some(friend);
18  }
19 
20  public abstract Task<Option<FriendInfo>> RetrieveFriend(AccountId id);
21  public abstract Task<ImmutableArray<FriendInfo>> RetrieveFriends();
22  public abstract Task<Option<Sprite>> RetrieveAvatar(FriendInfo friend, int avatarSize);
23  public abstract Task<string> GetSelfUserName();
24  }
25 }
abstract Task< Option< FriendInfo > > RetrieveFriend(AccountId id)
abstract Task< ImmutableArray< FriendInfo > > RetrieveFriends()
abstract Task< Option< Sprite > > RetrieveAvatar(FriendInfo friend, int avatarSize)
async Task< Option< FriendInfo > > RetrieveFriendWithAvatar(AccountId id, int size)
abstract Task< string > GetSelfUserName()