namespace BingoBrain
{
    // [System.Serializable]
    public class Task
    {
        public int Id { get;  set; }
        public int MaxProgress { get;  set; }
        public int Progress { get; set; }
        public bool IsReward { get; set; }
        public int RewardId { get; set; }
        public float RewardSum { get; set; }
        public bool IsMulti { get;  set; }
        public int cont_index { get;  set; }

        public Task(int id, int maxProgress)
        {
            Id = id;
            Progress = 0;
            IsReward = false;
            MaxProgress = maxProgress;
        }

        public void InitData()
        {
            TaskList  taskListVO = GameHelper.GetConfig<TaskListModel>().GetData(Id);
            RewardId = taskListVO.rewardID;
            IsMulti = taskListVO.isMulti;
            cont_index = taskListVO.cont_index;
            if (!PreferencesMgr.Instance.FinishTaskList.Contains(Id))
            {
                RewardSum = taskListVO.rewardFirst;
            }
            else
            {
                RewardSum = taskListVO.reward[GameHelper.GetDynamicIndex(RewardId)];
            }
        }
    }
}