Wiki

Clone wiki

RogueSharp / RogueSharp / IGoalMap / README

IGoalMap Interface

An interface for classes that assign weights to every cell on the Map and then use this for finding paths or building desire-driven AI

Namespace: RogueSharp
Assembly:

Syntax

publicinterfaceIGoalMap

The IGoalMap type exposes the following members.

Methods

Name Description
AddGoal Add a Goal at the specified location with the specified weight
AddObstacle Add an Obstacle at the specified location. Any paths found must not go through Obstacles
AddObstacles Add multiple obstacles from the specified enumeration of locations
ClearGoals Remove all goals from this GoalMap
ClearObstacles Remove all Obstacles from this GoalMap
FindPath Returns a shortest Path representing an ordered List of Points from the specified location to the Goal determined to have the highest priority Distance to the goals and the weight of the goals are both used in determining the priority The path must not pass through any obstacles specified in this GoalMap instance
FindPathAvoidingGoals Returns a Path representing an ordered list of Points from the specified location away from Goals specified in this GoalMap instance Distance to the goals and the weight of the goals are both used in determining the priority of avoiding the Goals The path must not pass through any Obstacles specified in this GoalMap instance
FindPaths Returns a ReadOnlyCollection of Paths representing all of the shortest paths from the specified location to the Goal or Goals determined to have the highest priority This method is useful when there are multiple paths that would all work and we want to have some additional logic to pick one of the best paths The FindPath( int x, int y ) method in the GoalMap class uses this method and then chooses the first path.
RemoveGoal Remove a Goal at the specified location
RemoveObstacle Remove an Obstacle at the specified location

Remarks

See Also

Reference

RogueSharp Namespace

Other Resources

Inspired by the article "The Incredible Power of Dijkstra Maps on roguebasin

[13]: 2014-2016 Faron Bracy

Updated