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