Skip to content

Commit

Permalink
target waypoint visualizer: Use IPatrollingAlgorithm instead
Browse files Browse the repository at this point in the history
This allows for advanced algorithms that does not make use of the
PatrollingAlgorithm base class.
  • Loading branch information
mads256h committed Jan 20, 2025
1 parent 258dae4 commit d7a87c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Assets/Scripts/Algorithms/IAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace Maes.Algorithms
{
public interface IAlgorithm
{
public void UpdateLogic();
void UpdateLogic();

public void SetController(Robot2DController controller);
void SetController(Robot2DController controller);

// Returns debug info that will be shown when the robot is selected
public string GetDebugInfo();
string GetDebugInfo();
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using Maes.PatrollingAlgorithms;
using Maes.Algorithms;
using Maes.Robot;
using Maes.Statistics;

namespace Maes.Map.Visualization.Patrolling
{
internal class PatrollingTargetWaypointVisualizationMode : IPatrollingVisualizationMode
{
private readonly PatrollingAlgorithm _algorithm;
private readonly IPatrollingAlgorithm _algorithm;

public PatrollingTargetWaypointVisualizationMode(MonaRobot robot)
{
_algorithm = (PatrollingAlgorithm)robot.Algorithm;
_algorithm = (IPatrollingAlgorithm)robot.Algorithm;
}

public void UpdateVisualization(PatrollingVisualizer visualizer, int currentTick)
Expand Down

0 comments on commit d7a87c6

Please sign in to comment.