Algorithms Class |
Namespace: Gamelogic.Grids
[VersionAttribute(1, 0, 0)] public static class Algorithms
The Algorithms type exposes the following members.
| Name | Description | |
|---|---|---|
| AggregateNeighborhoodTCell, TPoint(IGridTCell, TPoint, FuncTPoint, IEnumerableTPoint, TCell) | ||
| AggregateNeighborhoodTCell, TPoint, TResultGrid, TResultCell(IGridTCell, TPoint, FuncTPoint, IEnumerableTPoint, TResultCell) | ||
| AStarTCell, TPoint(IGridTCell, TPoint, TPoint, TPoint) |
Find the shortest path between a start and goal node.
The distance between nodes(as defined by TPoint.DistanceFrom)
are used as the heuristic and actual cost between nodes.In some cases the
result may be unintuitive, and an overload specifying a different
cost should be used.
See AStar<TCell, TPoint>(IGrid<TCell, TPoint>, TPoint, TPoint, Func<TPoint, TPoint, float>, Func<TCell, bool>, Func<TPoint, TPoint, float>)
| |
| AStarTCell, TPoint(IGridTCell, TPoint, TPoint, TPoint, FuncTPoint, TPoint, Single, FuncTCell, Boolean) | Obsolete.
Find the shortest path between a start and goal node.
The distance between nodes(as defined by TPoint.DistanceFrom)
are used as the actual cost between nodes.In some cases the
result may be unintuitive, and an overload specifying a different
cost should be used.
Using an overload with an appropriate distance function can solve the
issue.
See AStar<TCell, TPoint>(IGrid<TCell, TPoint>, TPoint, TPoint, Func<TPoint, TPoint, float>, Func<TCell, bool>, Func<TPoint, TPoint, float>)
| |
| AStarTCell, TPoint(IGridTCell, TPoint, TPoint, TPoint, FuncTPoint, TPoint, Single, FuncTCell, Boolean, FuncTPoint, TPoint, Single) | ||
| AStar2TCell, TPoint | ||
| ContainsTPoint | ||
| GetBiggestShapeTPoint |
Gets the biggest shape (by number of points) in the given list.
| |
| GetConnectedLinesTCell, TPoint, TBasePoint |
Gets the longest line of connected points that contains this point.
GetConnectedRaysTCell, TPoint(AbstractUniformGridTCell, TPoint, TPoint, FuncTPoint, TPoint, Boolean) | |
| GetConnectedRaysTCell, TPoint |
Returns a list containing lines connected to the given points. A line is a list of points.
Only returns correct results for square or hex grids.
| |
| GetConnectedSetTCell, TPoint | ||
| GetLongestConnectedTCell, TPoint, TBasePoint | Obsolete. | |
| GetLongestConnectedLineTCell, TPoint, TBasePoint |
Get the longest line of points connected to the given point
| |
| GetLongestConnectedRayTCell, TPoint |
Gets the longest of the rays connected to this cell.
GetConnectedRaysTCell, TPoint(AbstractUniformGridTCell, TPoint, TPoint, FuncTPoint, TPoint, Boolean) | |
| GetPointsInRangeTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTCell, Boolean, FuncTPoint, TPoint, Int32, Int32) | ||
| GetPointsInRangeTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTCell, Boolean, FuncTPoint, TPoint, Single, Single) |
A generic function that returns the points in range
based on a given start point, moveRange, and a function that returns the
cost of moving between neighboring cells.
author Justin Kivak
| |
| GetPointsInRangeCostTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTCell, Boolean, FuncTPoint, TPoint, Int32, Int32) | ||
| GetPointsInRangeCostTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTCell, Boolean, FuncTPoint, TPoint, Single, Single) |
A generic function that returns the points in range
based on a given start point, moveRange, and a function that returns the
cost of moving between neighboring cells.
author Justin Kivak
| |
| IsConnectedTCell, TPoint(IGridTCell, TPoint, IEnumerableTPoint, FuncTPoint, TPoint, Boolean) |
The set is connected if
the set of points are neighbor-connected, and isNeighborsConnected return true for each
two neighbors in the set.Two points are connected if they are neighbors, or one point has
a neighbor that is neighbor-connected with the other point.
| |
| IsConnectedTCell, TPoint(IGridTCell, TPoint, TPoint, TPoint, FuncTPoint, TPoint, Boolean) |
The set is connected if
the set of points are neighbor-connected, and isNeighborsConnected return true for each
two neighbors in the set.Two points are connected if they are neighbors, or one point has
a neighbor that is neighbor-connected with the other point.
Another way to put this is, this function returns true if there is a set that connects point1
to point2.
| |
| IsEquivalentTPoint | ||
| IsEquivalentUnderTransformsAndTranslationTPoint | ||
| IsEquivalentUnderTranslationTPoint | ||
| Rotate120About(IEnumerableFlatHexPoint, FlatHexPoint, FlatHexPoint, FlatHexPoint) |
Rotates a shape 120 degrees around the vertice shared by the three given points.
The three points must form a close triangle (they must share a vertex).
| |
| Rotate120About(IEnumerablePointyHexPoint, PointyHexPoint, PointyHexPoint, PointyHexPoint) |
Rotates a shape 120 degrees around the vertice shared by the three given points.
The three points must form a close triangle (they must share a vertex).
| |
| Rotate180About(IEnumerableFlatHexPoint, FlatHexPoint, FlatHexPoint) |
Rotates a shape 180 degrees around the edge shared by the two given points.
The two points must be neighbors.
| |
| Rotate180About(IEnumerablePointyHexPoint, PointyHexPoint, PointyHexPoint) |
Rotates a shape 180 degrees around the edge shared by the two given points.
The two points must be neighbors.
| |
| Rotate240About(IEnumerableFlatHexPoint, FlatHexPoint, FlatHexPoint, FlatHexPoint) |
Rotates a shape 240 degrees around the vertice shared by the three given points.
The three points must form a close triangle (they must share a vertex).
| |
| Rotate240About(IEnumerablePointyHexPoint, PointyHexPoint, PointyHexPoint, PointyHexPoint) |
Rotates a shape 240 degrees around the vertice shared by the three given points.
The three points must form a close triangle (they must share a vertex).
| |
| TransformShapeTPoint |
Transform each point in the list with the give point transformation.
|