diff --git a/Pathfinding/IPathfinder.cs b/Pathfinding/IPathfinder.cs index da5e7c1c6f..441440d0ce 100644 --- a/Pathfinding/IPathfinder.cs +++ b/Pathfinding/IPathfinder.cs @@ -4,12 +4,12 @@ using CalamityMod.Pathfinding.Movements; namespace CalamityMod.Pathfinding { /// - /// Defines an interface for a class that can use pathfinding. + /// Defines an interface for an object that can use pathfinding. /// public interface IPathfinder { /// - /// A enumerable collection of this pathfinder can use. + /// A enumerable collection of s this pathfinder can use while pathfinding. /// IEnumerable Movements { get; } diff --git a/Pathfinding/Movements/BaseEntityMovement.cs b/Pathfinding/Movements/BaseEntityMovement.cs deleted file mode 100644 index 6cf102ef10..0000000000 --- a/Pathfinding/Movements/BaseEntityMovement.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria.ModLoader; - -namespace CalamityMod.Pathfinding.Movements -{ - public abstract class BaseEntityMovement(TEntity pathfinder) : IMovement where TEntity : ModType, IPathfinder - { - public TEntity Pathfinder { get; } = pathfinder; - public abstract string RegistrationName { get; } - public abstract Func Cost { get; } - - public abstract void Start(); - public abstract bool FollowPath(Vector2 nextPoint); - public abstract IEnumerable GetDestinations(Point current); - } -} diff --git a/Pathfinding/Movements/IMovement.cs b/Pathfinding/Movements/IMovement.cs index 2b0584d28c..680ded0d7b 100644 --- a/Pathfinding/Movements/IMovement.cs +++ b/Pathfinding/Movements/IMovement.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Pathfinding.Movements { /// - /// Defines an interface for what is a movement in the context of pathfinding. - /// Every movement has a cost function, and a way to follow a path. + /// Defines an interface for different types of movement in the context of pathfinding. /// public interface IMovement { @@ -17,14 +16,15 @@ namespace CalamityMod.Pathfinding.Movements string RegistrationName { get; } /// - /// The cost function of this movement.
- /// Takes in two positions and returns the cost of the movement. + /// The cost of enacting this movement.
+ /// Takes in two positions and returns the cost of the movement.
+ /// Cost can be negative if you want to reward that type of movement, but can lead to unintended behavior. ///
Func Cost { get; } /// /// Defines a method that is run whenever this movement starts execution.
- /// Useful to get any variable set up for this movement's action. + /// Useful to get any variables set up for this movement's action. ///
void Start(); @@ -32,14 +32,14 @@ namespace CalamityMod.Pathfinding.Movements /// A method that defines the way to follow from one position to another. /// /// The destination of this movement. - /// if it this movement has finished; otherwise . + /// if this movement has finished; otherwise . bool FollowPath(Vector2 nextPoint); /// - /// Defines a method to retrieve the possiblement destinations that this movement can achieve + /// A method to retrieve the possible destinations that this movement can achieve. /// /// The starting position where this movement takes place. - /// An enumerable collection of with all the destinations. + /// An enumerable collection of s with all the possible destinations. IEnumerable GetDestinations(Point current); } } diff --git a/Pathfinding/Movements/Movement.cs b/Pathfinding/Movements/Movement.cs deleted file mode 100644 index 072afa87ea..0000000000 --- a/Pathfinding/Movements/Movement.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Microsoft.Xna.Framework; - -namespace CalamityMod.Pathfinding.Movements -{ - public abstract class Movement - { - public abstract float Cost { get; } - - public abstract bool FollowPath(IPathfinder pathfinder, Vector2 nextPoint); - - public abstract IEnumerable GetNeighborPositions(Point current); - } -}