StationObscurum/Assets/Scripts/Enemies/AI/AIV2/Strips/StripsGoal.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2024-02-12 08:23:19 +01:00
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;
2024-02-13 03:07:23 +01:00
//public StripsAction[] actions;
public StripsActionMap[] actions;
public Dictionary<StripsAction,int> WeightMap = new Dictionary<StripsAction,int>();
2024-02-12 08:23:19 +01:00
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++)
{
2024-02-13 03:07:23 +01:00
if (actions[i].action.EvaluateConditionals(updatedMappings))
2024-02-12 08:23:19 +01:00
{
2024-02-13 03:07:23 +01:00
available.Add(actions[i].action);
2024-02-12 08:23:19 +01:00
}
}
this.available=available;
}
2024-02-13 03:07:23 +01:00
[System.Serializable]
public class StripsActionMap {
public StripsAction action;
public float weight;
}
2024-02-12 08:23:19 +01:00
}
}