Wiki

Clone wiki

RogueSharp / RogueSharp / GoalMap / README

GoalMap Class

A class for assigning weights to every cell on the Map which can then be used for finding paths or building desire-driven AI

Inheritance Hierarchy

SystemObject
RogueSharpGoalMap

Namespace: RogueSharp
Assembly:

Syntax

public class GoalMap : IGoalMap

The GoalMap type exposes the following members.

Constructors

Name Description
GoalMap Constructs a new instance of a GoalMap for the specified Map

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
Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
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.
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetType Gets the Type of the current instance. (Inherited from Object.)
MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
RemoveGoal Remove a Goal at the specified location
RemoveObstacle Remove an Obstacle at the specified location
ToString Returns a string representation of the current GoalMap (Overrides ObjectToString.)

Remarks

See Also

Reference

RogueSharp Namespace

Other Resources

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

[15]: 2014-2016 Faron Bracy

Updated