diff --git a/PDDL/Model/PDDL12/EffectKind.cs b/PDDL/Model/PDDL12/EffectKind.cs new file mode 100644 index 0000000..b60d232 --- /dev/null +++ b/PDDL/Model/PDDL12/EffectKind.cs @@ -0,0 +1,29 @@ +namespace PDDL.Model.PDDL12 +{ + /// + /// Class ListType. + /// + public enum EffectKind + { + /// + /// The effect is negated. This is typically the + /// case with the remove list. + /// + Negated = -1, + + /// + /// No effect + /// + None = 0, + + /// + /// The effect is added. + /// + Regular = 1, + + /// + /// This is a composite effect. + /// + Conjunction = 1 + } +} diff --git a/PDDL/Model/PDDL12/Effects/ConjunctionEffect.cs b/PDDL/Model/PDDL12/Effects/ConjunctionEffect.cs index c19ac56..9955a25 100644 --- a/PDDL/Model/PDDL12/Effects/ConjunctionEffect.cs +++ b/PDDL/Model/PDDL12/Effects/ConjunctionEffect.cs @@ -21,7 +21,7 @@ public class ConjunctionEffect : EffectBase, IConjunctionEffect /// The effects. /// The value of 'effects' cannot be null. public ConjunctionEffect([NotNull] IReadOnlyList effects) - : base(ListType.Indifferent) + : base(EffectKind.Conjunction) { if (ReferenceEquals(effects, null)) throw new ArgumentNullException("effects", "effects must not be null"); Effects = effects; diff --git a/PDDL/Model/PDDL12/Effects/EffectBase.cs b/PDDL/Model/PDDL12/Effects/EffectBase.cs index c4de48d..82aa521 100644 --- a/PDDL/Model/PDDL12/Effects/EffectBase.cs +++ b/PDDL/Model/PDDL12/Effects/EffectBase.cs @@ -9,13 +9,13 @@ public abstract class EffectBase : IEffect /// Gets the list type. /// /// The list type. - public ListType Type { get; private set; } + public EffectKind Type { get; private set; } /// /// Initializes a new instance of the class. /// /// The type. - protected EffectBase(ListType type) + protected EffectBase(EffectKind type) { Type = type; } diff --git a/PDDL/Model/PDDL12/Effects/NegatedEffect.cs b/PDDL/Model/PDDL12/Effects/NegatedEffect.cs index bfb8c37..d79a994 100644 --- a/PDDL/Model/PDDL12/Effects/NegatedEffect.cs +++ b/PDDL/Model/PDDL12/Effects/NegatedEffect.cs @@ -20,7 +20,7 @@ public class NegatedEffect : EffectBase, INegatedEffect /// The effects. /// The value of 'effects' cannot be null. public NegatedEffect([NotNull] IAtomicFormula effects) - : base(ListType.Remove) + : base(EffectKind.Negated) { if (ReferenceEquals(effects, null)) throw new ArgumentNullException("effects", "effects must not be null"); Effects = effects; diff --git a/PDDL/Model/PDDL12/Effects/RegularEffect.cs b/PDDL/Model/PDDL12/Effects/RegularEffect.cs index 687c747..d2209b9 100644 --- a/PDDL/Model/PDDL12/Effects/RegularEffect.cs +++ b/PDDL/Model/PDDL12/Effects/RegularEffect.cs @@ -20,7 +20,7 @@ public class RegularEffect : EffectBase, IRegularEffect /// The effects. /// The value of 'effects' cannot be null. public RegularEffect([NotNull] IAtomicFormula effects) - : base(ListType.Add) + : base(EffectKind.Regular) { if (ReferenceEquals(effects, null)) throw new ArgumentNullException("effects", "effects must not be null"); Effects = effects; diff --git a/PDDL/Model/PDDL12/IEffect.cs b/PDDL/Model/PDDL12/IEffect.cs index 2d0df4c..1395e51 100644 --- a/PDDL/Model/PDDL12/IEffect.cs +++ b/PDDL/Model/PDDL12/IEffect.cs @@ -12,7 +12,7 @@ public interface IEffect /// Gets the list type. /// /// The list type. - ListType Type { get; } + EffectKind Type { get; } } /// diff --git a/PDDL/Model/PDDL12/ListType.cs b/PDDL/Model/PDDL12/ListType.cs deleted file mode 100644 index 00b6a17..0000000 --- a/PDDL/Model/PDDL12/ListType.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace PDDL.Model.PDDL12 -{ - /// - /// Class ListType. - /// - public enum ListType - { - /// - /// Remove list - /// - Remove = -1, - - /// - /// Indifferent - /// - Indifferent = 0, - - /// - /// Add list - /// - Add = 1 - } -} diff --git a/PDDL/Model/PDDL12/Null/NullEffect.cs b/PDDL/Model/PDDL12/Null/NullEffect.cs index a75536c..5cda20a 100644 --- a/PDDL/Model/PDDL12/Null/NullEffect.cs +++ b/PDDL/Model/PDDL12/Null/NullEffect.cs @@ -24,7 +24,7 @@ public sealed class NullEffect : EffectBase /// /// Initializes a new instance of the class. /// - public NullEffect() : base(ListType.Indifferent) + public NullEffect() : base(EffectKind.None) { } } diff --git a/PDDL/PDDL.csproj b/PDDL/PDDL.csproj index b7d6749..cc21214 100644 --- a/PDDL/PDDL.csproj +++ b/PDDL/PDDL.csproj @@ -88,7 +88,7 @@ - + diff --git a/PDDL/Parser/PDDL12/EffectGrammar.cs b/PDDL/Parser/PDDL12/EffectGrammar.cs index 06e51e0..b3fb49a 100644 --- a/PDDL/Parser/PDDL12/EffectGrammar.cs +++ b/PDDL/Parser/PDDL12/EffectGrammar.cs @@ -39,7 +39,7 @@ private static Parser CreateEffect() { Parser positiveEffect = (from af in CommonGrammar.AtomicFormulaOfTerm - select new AddEffect(af)).Token(); + select new RegularEffect(af)).Token(); Parser negativeEffect = ( @@ -47,7 +47,7 @@ from open in CommonGrammar.OpeningParenthesis from keyword in Keywords.Not from af in CommonGrammar.AtomicFormulaOfTerm from close in CommonGrammar.ClosingParenthesis - select new RemoveEffect(af)).Token(); + select new NegatedEffect(af)).Token(); Parser conjunctionEffect = (