setupPathFinding method
void
setupPathFinding({
- bool? linePathEnabled,
- Color? pathLineColor,
- Color? barriersCalculatedColor,
- double pathLineStrokeWidth = 4,
- bool showBarriersCalculated = false,
- bool useOnlyVisibleBarriers = true,
- bool useAreaBetweenPlayerAndTarget = false,
- bool gridSizeIsCollisionSize = false,
- bool withDiagonal = true,
- double factorInflateFindArea = 2,
Implementation
void setupPathFinding({
bool? linePathEnabled,
/// Use to set line path color
Color? pathLineColor,
Color? barriersCalculatedColor,
/// Use to set line path width
double pathLineStrokeWidth = 4,
/// Use to debug and show area collision calculated
bool showBarriersCalculated = false,
bool useOnlyVisibleBarriers = true,
/// If `true` the algorithm use the area between player and target to find the path, if false this use the entire map.
bool useAreaBetweenPlayerAndTarget = false,
/// If `false` the algorithm use map tile size with base of the grid.
/// if true this use collision size of the component.
bool gridSizeIsCollisionSize = false,
bool withDiagonal = true,
double factorInflateFindArea = 2,
}) {
_withDiagonal = withDiagonal;
_linePathEnabled = linePathEnabled ?? _linePathEnabled;
_useOnlyVisibleBarriers = useOnlyVisibleBarriers;
_factorInflateFindArea = factorInflateFindArea;
_paintShowBarriers.color =
barriersCalculatedColor ?? const Color(0xFF2196F3).setOpacity(0.5);
_showBarriers = showBarriersCalculated;
_pathLineColor = pathLineColor ?? _pathLineColor;
_pathLineStrokeWidth = pathLineStrokeWidth;
_pathLineColor = pathLineColor ?? const Color(0xFF40C4FF).setOpacity(0.5);
_gridSizeIsCollisionSize = gridSizeIsCollisionSize;
_useAreaBetweenPlayerAndTarget = useAreaBetweenPlayerAndTarget;
}