Unnecessary Files

This commit is contained in:
Memes authored and Cameron Ewell committed 2025-11-25 16:28:43 -05:00
1 parent d6fe95bbd7
commit 43c9c4275c
4 files changed
+10 -42

No files matched your search

+2 -2
View File
@@ -4,12 +4,12 @@ using CalamityMod.Pathfinding.Movements;
namespace CalamityMod.Pathfinding
{
/// <summary>
/// Defines an interface for a class that can use pathfinding.
/// Defines an interface for an object that can use pathfinding.
/// </summary>
public interface IPathfinder
{
/// <summary>
/// A enumerable collection of <see cref="IMovement"/> this pathfinder can use.
/// A enumerable collection of <see cref="IMovement"/>s this pathfinder can use while pathfinding.
/// </summary>
IEnumerable<IMovement> Movements { get; }
@@ -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>(TEntity pathfinder) : IMovement where TEntity : ModType, IPathfinder
{
public TEntity Pathfinder { get; } = pathfinder;
public abstract string RegistrationName { get; }
public abstract Func<Point, Point, float> Cost { get; }
public abstract void Start();
public abstract bool FollowPath(Vector2 nextPoint);
public abstract IEnumerable<Point> GetDestinations(Point current);
}
}
+8 -8
View File
@@ -5,8 +5,7 @@ using Microsoft.Xna.Framework;
namespace CalamityMod.Pathfinding.Movements
{
/// <summary>
/// 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.
/// </summary>
public interface IMovement
{
@@ -17,14 +16,15 @@ namespace CalamityMod.Pathfinding.Movements
string RegistrationName { get; }
/// <summary>
/// The cost function of this movement.<br/>
/// Takes in two positions and returns the cost of the movement.
/// The cost of enacting this movement.<br/>
/// Takes in two positions and returns the cost of the movement.<br/>
/// Cost can be negative if you want to reward that type of movement, but can lead to unintended behavior.
/// </summary>
Func<Point, Point, float> Cost { get; }
/// <summary>
/// Defines a method that is run whenever this movement starts execution.<br/>
/// Useful to get any variable set up for this movement's action.
/// Useful to get any variables set up for this movement's action.
/// </summary>
void Start();
@@ -32,14 +32,14 @@ namespace CalamityMod.Pathfinding.Movements
/// A method that defines the way to follow from one position to another.
/// </summary>
/// <param name="nextPoint">The destination of this movement.</param>
/// <returns><see langword="true"/> if it this movement has finished; otherwise <see langword="false"/>.</returns>
/// <returns><see langword="true"/> if this movement has finished; otherwise <see langword="false"/>.</returns>
bool FollowPath(Vector2 nextPoint);
/// <summary>
/// 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.
/// </summary>
/// <param name="current">The starting position where this movement takes place.</param>
/// <returns>An enumerable collection of <see cref="Point"/> with all the destinations.</returns>
/// <returns>An enumerable collection of <see cref="Point"/>s with all the possible destinations.</returns>
IEnumerable<Point> GetDestinations(Point current);
}
}
-14
View File
@@ -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<Point> GetNeighborPositions(Point current);
}
}