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

35 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
[Serializable]
public class CollectRequiredSubjectData : RequiredSubjectData
{
protected override string MODEL_LOCALIZATION => "Items/";
public CollectRequiredSubjectData(int requiredAmount) : base(requiredAmount) { }
public CollectRequiredSubjectData(int requiredAmount, string requiredObjectName) : base(requiredAmount, requiredObjectName) { }
public CollectRequiredSubjectData(CollectRequiredSubject requiredSubject) : base(requiredSubject) { }
public override RequiredSubject MapDataToObject(string prefarbAssetName)
{
var newCollectRequirement = new CollectRequiredSubject(RequiredAmount);
newCollectRequirement.RequiredObject = newCollectRequirement.FindObjectInResource(prefarbAssetName);
return newCollectRequirement;
}
public override RequiredSubject MapDataToObject()
{
return new CollectRequiredSubject(RequiredAmount, RequiredObjectName);
}
}