major refactoring, maybe some bugfixes, idk
This commit is contained in:
43
MareSynchronos/Models/CachedPlayer.cs
Normal file
43
MareSynchronos/Models/CachedPlayer.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||
using MareSynchronos.API;
|
||||
|
||||
namespace MareSynchronos.Models;
|
||||
|
||||
public class CachedPlayer
|
||||
{
|
||||
private bool _isVisible = false;
|
||||
|
||||
public CachedPlayer(string nameHash)
|
||||
{
|
||||
PlayerNameHash = nameHash;
|
||||
}
|
||||
|
||||
public Dictionary<int, CharacterCacheDto> CharacterCache { get; set; } = new();
|
||||
public bool IsVisible
|
||||
{
|
||||
get => _isVisible;
|
||||
set
|
||||
{
|
||||
WasVisible = _isVisible;
|
||||
_isVisible = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int? JobId { get; set; }
|
||||
public PlayerCharacter? PlayerCharacter { get; set; }
|
||||
public string? PlayerName { get; set; }
|
||||
public string PlayerNameHash { get; }
|
||||
public bool WasVisible { get; private set; }
|
||||
public void Reset()
|
||||
{
|
||||
PlayerName = string.Empty;
|
||||
JobId = null;
|
||||
PlayerCharacter = null;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return PlayerNameHash + " : " + PlayerName + " : HasChar " + (PlayerCharacter != null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user