using UnityEngine;

namespace Wizard;

public class GatheringRankingPlate : UserPlateBase
{
	private const string BG_RANK_1 = "ranking_plate_01";

	private const string BG_RANK_2 = "ranking_plate_02";

	private const string BG_RANK_3 = "ranking_plate_03";

	private const string BG_RANK_OTHER = "ranking_plate_common";

	[SerializeField]
	private UILabel _winCount;

	[SerializeField]
	private UILabel _ranking;

	[SerializeField]
	private GameObject _youMark;

	[SerializeField]
	private UISprite _bg;

	public void Initialize(GatheringRankingTask.RankingUserInfo userInfo)
	{
		InitializeBase(userInfo.gatheringUserInfo);
		_winCount.text = Data.SystemText.Get("Gathering_Ranking_0001", userInfo.WinCount.ToString());
		_ranking.text = userInfo.Order.ToString();
		_youMark.SetActive(userInfo.gatheringUserInfo.IsSelf);
		switch (userInfo.Order)
		{
		case 1:
			_bg.spriteName = "ranking_plate_01";
			break;
		case 2:
			_bg.spriteName = "ranking_plate_02";
			break;
		case 3:
			_bg.spriteName = "ranking_plate_03";
			break;
		default:
			_bg.spriteName = "ranking_plate_common";
			break;
		}
	}
}
