StationObscurum/Assets/Scripts/Enemies/AI/AIV2/Strips/StripsGoal.cs
2024-02-12 21:07:23 -05:00

41 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace STRIPS
{
[CreateAssetMenu(fileName = "New Goal", menuName = "STRIPS/Create New Goal", order = 3)]
public class StripsGoal : ScriptableObject
{
public string goalName;
//public StripsAction[] actions;
public StripsActionMap[] actions;
public Dictionary<StripsAction,int> WeightMap = new Dictionary<StripsAction,int>();
private List<StripsAction> available;
public List<StripsAction> Available { get { return available; } }
public void UpdateActionConditionals(StripsVariableMapping.PackageMapping updatedMappings)
{
List<StripsAction> available = new List<StripsAction> ();
for(int i =0; i < actions.Length; i++)
{
if (actions[i].action.EvaluateConditionals(updatedMappings))
{
available.Add(actions[i].action);
}
}
this.available=available;
}
[System.Serializable]
public class StripsActionMap {
public StripsAction action;
public float weight;
}
}
}