using System.Linq; using Goap.Core; namespace Goap.Runtime { public class ActionEffectKeyValidator : IValidator { public void Validate(IAgentTypeConfig agentTypeConfig, IValidationResults results) { foreach (var configAction in agentTypeConfig.Actions) { var missing = configAction.Effects.Where(x => x.WorldKey == null).ToArray(); if (!missing.Any()) continue; results.AddError($"Action {configAction.Name} has effects without WorldKey"); } } } }