Scriptum/Assets/Scripts/REFACTORING/Models/Dialogue/DialogueData.cs

67 lines
1.8 KiB
C#
Raw Normal View History

2023-01-01 17:03:35 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
[Serializable]
public abstract class DialogueData<T> : ModelData<T, T>
{
protected override string SPRITE_LOCALIZATION => "";
protected override string MODEL_LOCALIZATION => "Dialogue/";
[SerializeField]
public int CurrentStep;
[SerializeField]
public List<DialogueStepData> DialogueStepModelDataList = new List<DialogueStepData>();
}
public class DialogueData : DialogueData<Dialogue>
{
/// <summary>
/// build Data model based on Object
/// </summary>
/// <param name="dialogue"></param>
public DialogueData(Dialogue dialogue)
{
CurrentStep = dialogue.CurrentStep;
DialogueStepModelDataList.Clear();
foreach(DialogueStepModel dialogueStepModelData in dialogue.DialogueSteps)
{
/*
* pass WasDisplayed value from model to data representative class
*/
DialogueStepModelDataList.Add(new DialogueStepData(dialogueStepModelData.WasDisplayed));
}
}
#region NotImplemented
/*
* we dont want to map it here, we will mark fields in NpcDialogfeManager after each loading and fetching dialogue
*/
public override Dialogue MapDataToObject(string prefarbAssetName)
{
throw new NotImplementedException();
}
/*
* we dont want to map it here, we will mark fields in NpcDialogfeManager after each loading and fetching dialogue
*/
public override Dialogue MapDataToObject()
{
throw new NotImplementedException();
}
protected override Dialogue TryFindResource(string modelName)
{
throw new NotImplementedException();
}
#endregion
}