using LitJson;
using Wizard;

public class SpecialCrystalInfo
{
	public string ProductId { get; private set; }

	public int AvailablePurchaseCount { get; private set; }

	public RemainTime RemainTime { get; private set; }

	public string DialogTitle { get; private set; }

	public string DialogBGImageFileName { get; private set; }

	public bool EnableExtraResult { get; private set; }

	public int ExtraResultPurchaseCount { get; private set; }

	public string ExtraResultDialogBGImageFileName { get; private set; }

	public string ResultDialogNextSceneClick { get; private set; }

	public string ResultDialogNextSceneStatus { get; private set; }

	public string Status { get; private set; }

	public SpecialCrystalInfo(JsonData json, JsonData responseData)
	{
		ProductId = json["product_id"].ToString();
		AvailablePurchaseCount = json["available_purchase_num"].ToInt();
		RemainTime = new RemainTime(json["end_time"].ToString(), responseData["data_headers"]["servertime"].ToDouble());
		DialogTitle = json["dialog_top_title"].ToString();
		DialogBGImageFileName = json["dialog_top_img"].ToString();
		Status = json["status_id"].ToString();
		if (json.Keys.Contains("ex_dialog_img"))
		{
			EnableExtraResult = true;
			ExtraResultPurchaseCount = json["ex_dialog_condtion_available_purchase_num"].ToInt();
			ExtraResultDialogBGImageFileName = json["ex_dialog_img"].ToString();
			ResultDialogNextSceneClick = json["ex_dialog_click"].ToString();
			ResultDialogNextSceneStatus = json["ex_dialog_status"].ToString();
		}
		else
		{
			EnableExtraResult = false;
			ExtraResultPurchaseCount = -1;
			ExtraResultDialogBGImageFileName = string.Empty;
			ResultDialogNextSceneClick = string.Empty;
			ResultDialogNextSceneStatus = string.Empty;
		}
	}
}
