jps-0.1.0.0: Jump point search for Haskell

Safe HaskellNone
LanguageHaskell2010

Algorithm.Search.JumpPoint

Synopsis

Documentation

data JumpGrid Source #

The pathfinding grid.

type Point = (Int, Int) Source #

A point on the grid.

make Source #

Arguments

:: Int

Grid width

-> Int

Grid height

-> JumpGrid 

Creates a JumpGrid with all nodes open.

closeArea Source #

Arguments

:: Point

First point

-> Point

Second point

-> JumpGrid 
-> JumpGrid 

Close a square defined by two points on the JumpGrid.

openArea Source #

Arguments

:: Point

First point

-> Point

Second point

-> JumpGrid 
-> JumpGrid 

Open a square defined by two points on the JumpGrid.

findPath Source #

Arguments

:: JumpGrid

Grid

-> Point

Source location

-> Point

Destination location

-> Maybe [Point] 

Attempt to pathfind over a JumpGrid.

isTileOpen :: JumpGrid -> Point -> Bool Source #

Returns True iff a point on the grid is open.