File size: 977 Bytes
ce81a16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Collections.Generic;
using Photon.Deterministic;


namespace Quantum
{
	public abstract partial class GOAPBackValidation
	{
		public abstract void ValidatePlanState(Frame frame, EntityRef entity, GOAPState stateToValidate, GOAPState nextState, FP costToNextState, List<StateBackValidation> validatedStates);
	}

	public abstract class GOAPSingleBackValidation : GOAPBackValidation
	{
		public override sealed void ValidatePlanState(Frame frame, EntityRef entity, GOAPState stateToValidate, GOAPState nextState, FP costToNextState,
			List<StateBackValidation> validatedStates)
		{
			if (ValidatePlanState(frame, entity, ref stateToValidate, nextState, ref costToNextState) == true)
			{
				validatedStates.Add(new StateBackValidation(stateToValidate, costToNextState));
			}
		}

		protected virtual bool ValidatePlanState(Frame frame, EntityRef entity, ref GOAPState stateToValidate, GOAPState nextState, ref FP costToNextState)
		{
			return false;
		}
	}
}