A class in Root.Township, the global namespace.
Networked scroller for picking one of a player's friends. Syncs the list as user IDs, and each client keeps only the ones in its own friends list. SetPlayer is empty in this build, so nothing fills the list.
Constructors
| Member | What it is |
|---|
FriendSelector() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private IPlayer currentPlayer | Not used in this build. |
private Task filteringTask | Not used in this build. |
private List<UserInfo> friends | The friends shown, as user ID and username. |
private bool isCancelling | Not used in this build. |
private static Logger logger | Class logger. |
private ScrollerSelector scroller | The scroller that shows the friend names. |
private MethodSync syncFilter | Method sync for the friend list (SyncB). |
Properties
| Member | What it is |
|---|
int CurrentFriend { get; } | User ID of the friend under the scroller, or -1 with no friends. |
Events
| Member | What it is |
|---|
event Action<int> UpdatedFriendSelection | Raised with the user ID of the newly selected friend. |
event Action<IProvideEnumerable<string>> UpdatedValues | Raised when the friend list changes, with this as the source of names. |
Methods
| Member | What it is |
|---|
override void Initialize() | Sets up the friend list sync and listens to the scroller. |
async void SetPlayer(IPlayer player) | Empty in this build. |
2 private and internal methods
| Member | What it is |
|---|
private void SyncFilter(IPlayer player, Stream stream) | Writes the friend IDs, or reads them and rebuilds the list from the local player's friends, then raises UpdatedValues. |
private void UpdateFriend(int index) | Scroller handler that raises UpdatedFriendSelection with the chosen friend's ID. |
Used in
Members of other types that take, return or hold a FriendSelector: