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

67 lines
1.6 KiB
C#
Raw Permalink 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]
2023-01-02 00:05:47 +01:00
public abstract class MultiDialogueData<T> : IModelMapper<T>
2023-01-01 17:03:35 +01:00
{
2023-01-02 00:05:47 +01:00
[NonSerialized]
public string name;
[NonSerialized]
public string modelName;
2023-01-01 17:03:35 +01:00
[SerializeField]
public string SpeakerName;
[SerializeField]
public int CurrentDialogue;
[SerializeField]
public List<IndexValuePair<int, DialogueData>> DialogueStepModelDataList = new List<IndexValuePair<int, DialogueData>>();
2023-01-02 00:05:47 +01:00
#region NotImplemented
/*
* we dont want to map it here, we will mark fields in NpcDialogfeManager after each loading and fetching dialogue
*/
public T MapDataToObject(string prefarbAssetName)
{
throw new NotImplementedException();
}
public T MapDataToObject()
{
throw new NotImplementedException();
}
#endregion
2023-01-01 17:03:35 +01:00
}
2023-01-02 00:05:47 +01:00
[Serializable]
2023-01-01 17:03:35 +01:00
public class MultiDialogueData : MultiDialogueData<MultiDialogue>
{
public MultiDialogueData(MultiDialogue dialogue)
{
SpeakerName = dialogue.SpeakerName;
CurrentDialogue = dialogue.CurrentDialogue;
DialogueStepModelDataList.Clear();
foreach(IndexValuePair<int, Dialogue> DialogueStepModelData in dialogue.Dialogues)
{
DialogueStepModelDataList.Add(
new IndexValuePair<int, DialogueData>(
DialogueStepModelData.Key,
new DialogueData(DialogueStepModelData.Value)
)
);
}
}
}