Scriptum/Assets/Scripts/REFACTORING/Models/Mission/Condition/KillMissionConditionData.cs
2023-01-03 22:44:24 +01:00

49 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
[Serializable]
public class KillMissionConditionData : MissionConditionData
{
public KillMissionConditionData(MissionCondition missionCondition) : base(missionCondition.Type)
{
RequiredElements.Clear();
foreach (RequiredSubject requiredSubject in missionCondition.RequiredElements)
{
/* var abc = new KillRequiredSubjectData((KillRequiredSubject)requiredSubject);
var converter = TypeDescriptor.GetConverter(typeof(KillRequiredSubjectData));
var def = converter.ConvertFrom(abc);
Debug.Log(def);*/
RequiredElements.Add(new KillRequiredSubjectData((KillRequiredSubject)requiredSubject));
}
}
public override MissionCondition MapDataToObject(string prefarbAssetName)
{
throw new NotImplementedException();
}
public override MissionCondition MapDataToObject()
{
var mappedCondition = new MissionCondition(Type);
foreach (var requiredElement in RequiredElements)
{
mappedCondition.RequiredElements.Add(requiredElement.MapDataToObject());
}
return mappedCondition;
}
}