diff --git a/aplib.net-demo/Assets/Testing/AplibTests/ConnectedComponentsTests.cs b/aplib.net-demo/Assets/Testing/AplibTests/ConnectedComponentsTests.cs index 10f2c603..3725203e 100644 --- a/aplib.net-demo/Assets/Testing/AplibTests/ConnectedComponentsTests.cs +++ b/aplib.net-demo/Assets/Testing/AplibTests/ConnectedComponentsTests.cs @@ -40,7 +40,7 @@ public ConnectedComponentsBeliefSet() GetCurrentTarget = new( reference: TargetPositionsInConnectedComponents, getObservationFromReference: positions => positions.Peek(), - shouldUpdate: () => + shouldUpdate: _ => { if (TargetPositionsInConnectedComponents.Count == 0) return false; diff --git a/aplib.net-demo/Assets/Testing/AplibTests/GameplayTests.cs b/aplib.net-demo/Assets/Testing/AplibTests/GameplayTests.cs index 8dab3c6b..0aa09715 100644 --- a/aplib.net-demo/Assets/Testing/AplibTests/GameplayTests.cs +++ b/aplib.net-demo/Assets/Testing/AplibTests/GameplayTests.cs @@ -17,17 +17,17 @@ using UnityEngine.SceneManagement; using UnityEngine.TestTools; using static Aplib.Core.Combinators; -using Goal = Aplib.Core.Desire.Goals.Goal; using Action = Aplib.Core.Intent.Actions.Action; -using Tactic = Aplib.Core.Intent.Tactics.Tactic; -using PrimitiveTactic = Aplib.Core.Intent.Tactics.PrimitiveTactic; -using GoalStructure = Aplib.Core.Desire.GoalStructures.GoalStructure; -using SequentialGoalStructure = Aplib.Core.Desire.GoalStructures.SequentialGoalStructure; -using DesireSet = Aplib.Core.Desire.DesireSets.DesireSet; using BdiAgent = Aplib.Core.Agents.BdiAgent; -using TransformPathfinderAction = Aplib.Integrations.Unity.Actions.TransformPathfinderAction; +using DesireSet = Aplib.Core.Desire.DesireSets.DesireSet; +using Goal = Aplib.Core.Desire.Goals.Goal; +using GoalStructure = Aplib.Core.Desire.GoalStructures.GoalStructure; using IGoalStructure = Aplib.Core.Desire.GoalStructures.IGoalStructure; using InterruptGuard = System.Func; +using PrimitiveTactic = Aplib.Core.Intent.Tactics.PrimitiveTactic; +using SequentialGoalStructure = Aplib.Core.Desire.GoalStructures.SequentialGoalStructure; +using Tactic = Aplib.Core.Intent.Tactics.Tactic; +using TransformPathfinderAction = Aplib.Integrations.Unity.Actions.TransformPathfinderAction; namespace Testing.AplibTests { @@ -150,7 +150,7 @@ public class GameplayBeliefSet : BeliefSet /// The position to which the player must navigate in order to fetch the end item. public readonly Belief EndItemPosition = new( GameObject.Find(EndItemName), x => x.transform.position, - () => !GameObject.Find("InventoryObject").GetComponent().ContainsItem(EndItemName)); + _ => !GameObject.Find("InventoryObject").GetComponent().ContainsItem(EndItemName)); /// The position of where the player started public readonly Belief WinAreaPosition = new( @@ -198,7 +198,7 @@ public readonly ? (enemy, distance) : (null, 0f)) .Where(x => x.enemy != null) - .Aggregate((new AbstractEnemy[] {}, new float[] {}), (acc, x) + .Aggregate((new AbstractEnemy[] { }, new float[] { }), (acc, x) => (acc.Item1.Append(x.enemy).ToArray(), acc.Item2.Append(x.distance).ToArray()))); public readonly Belief AnyEnemyVisible = new( @@ -229,8 +229,8 @@ public AbstractEnemy DetermineEnemyToFocus(out float distance) int enemyPriority = enemies[i] switch { MeleeEnemy when distances[i] < 5 => 0, - RangedEnemy => 1, - _ => 2 + RangedEnemy => 1, + _ => 2 }; groupedEnemies[enemyPriority].Add(i); } @@ -567,7 +567,7 @@ bool playerIsInWinAreaPredicate(GameplayBeliefSet beliefSet) DesireSet desireSet = new( mainGoal: fetchElixir, // Fetch the elixir and bring it to the final room - sideGoals: new (IGoalStructure, InterruptGuard)[] + sideGoals: new (IGoalStructure, System.Predicate)[] { // But, when an item can be picked up, do so (fetchVisibleItemGoal, beliefSet => @@ -743,7 +743,7 @@ bool playerIsInWinAreaPredicate(GameplayBeliefSet beliefSet) Transform playerRotation = beliefSet.PlayerRotation.Observation.transform; Vector3 enemyPosition = beliefSet.DetermineEnemyToFocus(out _).transform.position; playerRotation.transform.LookAt(enemyPosition); // Weapon viewpoint should be set to player rotation in editor - } ); + }); PrimitiveTactic sleep = new(sleepAction, _ => Time.time < wakeUpTimeStamp); @@ -860,7 +860,7 @@ bool playerIsInWinAreaPredicate(GameplayBeliefSet beliefSet) DesireSet desireSet = new( mainGoal: fetchElixir, // Fetch the elixir and bring it to the final room - sideGoals: new (IGoalStructure, InterruptGuard)[] + sideGoals: new (IGoalStructure, System.Predicate)[] { // But, when an item can be picked up, do so (fetchVisibleItemGoal, beliefSet => diff --git a/aplib.net-demo/Packages/packages-lock.json b/aplib.net-demo/Packages/packages-lock.json index 0407692c..1a028092 100644 --- a/aplib.net-demo/Packages/packages-lock.json +++ b/aplib.net-demo/Packages/packages-lock.json @@ -5,7 +5,7 @@ "depth": 0, "source": "git", "dependencies": {}, - "hash": "374c6a03c09eb8938d0377d7317e9e064b519b6f" + "hash": "7fd7754cebd06c5407d107bc0c273f539f88c9b7" }, "com.unity.ai.navigation": { "version": "1.1.5",