| | 1 | | using DCL.Helpers; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | public class FriendEntryModel |
| | 5 | | { |
| | 6 | | public string userId; |
| | 7 | | public PresenceStatus status; |
| | 8 | | public string userName; |
| | 9 | | public Vector2 coords; |
| | 10 | | public string realm; |
| | 11 | | public string realmServerName; |
| | 12 | | public string realmLayerName; |
| | 13 | | public ILazyTextureObserver avatarSnapshotObserver; |
| | 14 | | public bool blocked; |
| | 15 | |
|
| 0 | 16 | | public FriendEntryModel() |
| | 17 | | { |
| 0 | 18 | | } |
| | 19 | |
|
| 3 | 20 | | public FriendEntryModel(FriendEntryModel model) |
| | 21 | | { |
| 3 | 22 | | userId = model.userId; |
| 3 | 23 | | status = model.status; |
| 3 | 24 | | userName = model.userName; |
| 3 | 25 | | coords = model.coords; |
| 3 | 26 | | realm = model.realm; |
| 3 | 27 | | realmServerName = model.realmServerName; |
| 3 | 28 | | realmLayerName = model.realmLayerName; |
| 3 | 29 | | avatarSnapshotObserver = model.avatarSnapshotObserver; |
| 3 | 30 | | blocked = model.blocked; |
| 3 | 31 | | } |
| | 32 | |
|
| | 33 | | public virtual void CopyFrom(FriendsController.UserStatus status) |
| | 34 | | { |
| 9 | 35 | | userId = status.userId; |
| 9 | 36 | | this.status = status.presence; |
| 9 | 37 | | coords = status.position; |
| | 38 | |
|
| 9 | 39 | | if (status.realm != null) |
| | 40 | | { |
| 3 | 41 | | realm = $"{status.realm.serverName.ToUpperFirst()} {status.realm.layer.ToUpperFirst()}"; |
| 3 | 42 | | realmServerName = status.realm.serverName; |
| 3 | 43 | | realmLayerName = status.realm.layer; |
| 3 | 44 | | } |
| | 45 | | else |
| | 46 | | { |
| 6 | 47 | | realm = string.Empty; |
| 6 | 48 | | realmServerName = string.Empty; |
| 6 | 49 | | realmLayerName = string.Empty; |
| | 50 | | } |
| 6 | 51 | | } |
| | 52 | |
|
| | 53 | | public virtual void CopyFrom(UserProfile userProfile) |
| | 54 | | { |
| 15 | 55 | | userId = userProfile.userId; |
| 15 | 56 | | userName = userProfile.userName; |
| 15 | 57 | | avatarSnapshotObserver = userProfile.snapshotObserver; |
| 15 | 58 | | } |
| | 59 | | } |