Click or drag to resize

AlgorithmsGetPointsInRangeCostTCell, TPoint Method (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

Namespace:  Gamelogic.Grids
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(1, 10, 0)]
public static Dictionary<TPoint, float> GetPointsInRangeCost<TCell, TPoint>(
	IGrid<TCell, TPoint> grid,
	TPoint start,
	Func<TCell, bool> isAcessible,
	Func<TPoint, TPoint, float> getCellMoveCost,
	float moveRange
)
where TPoint : Object, IGridPoint<TPoint>

Parameters

grid
Type: Gamelogic.GridsIGridTCell, TPoint
The grid to use for the calculations
start
Type: TPoint
The starting point for the range calculation
isAcessible
Type: SystemFuncTCell, Boolean
getCellMoveCost
Type: SystemFuncTPoint, TPoint, Single
A function that returns the move cost given a cell
moveRange
Type: SystemSingle
The range from which to return cells

Type Parameters

TCell
TPoint

Return Value

Type: DictionaryTPoint, Single
Examples
Example usage:
var costs = Algorithms.GetPointsInRangeCost(
    grid,
    start,
    tile1, tile2 => DistanceBetween(tile1, tile2),
    5f);
See Also