using System.Collections.Generic;
using Cute;
using LitJson;

namespace Wizard;

public class ChatUserInfo
{
	public int ViewerId { get; private set; }

	public string Name { get; private set; }

	public long EmblemId { get; private set; }

	public long DegreeId { get; private set; }

	public ChatUserInfo(JsonData json)
	{
		initialize();
		ParseJsonData(json);
	}

	public bool IsMyself()
	{
		return ViewerId == PlayerStaticData.UserViewerID;
	}

	public List<string> GetResourcePathList()
	{
		List<string> list = new List<string>();
		list.Add(Toolbox.ResourcesManager.GetAssetTypePath(EmblemId.ToString(), ResourcesManager.AssetLoadPathType.Emblem_M));
		list.AddRange(DegreeHelper.GetDegreeResourceList(DegreeId, DegreeHelper.DegreeType.SMALL, isFetch: false));
		return list;
	}

	private void initialize()
	{
		ViewerId = 0;
		Name = null;
		EmblemId = 0L;
		DegreeId = 0L;
	}

	private void ParseJsonData(JsonData json)
	{
		ViewerId = json["viewer_id"].ToInt();
		Name = json["name"].ToString();
		EmblemId = json["emblem_id"].ToLong();
		DegreeId = json["degree_id"].ToLong();
	}
}
