Implement first weapon into tree structure
This commit is contained in:
@@ -8,6 +8,8 @@ import Geometry
|
||||
|
||||
import Data.List (nub,sortBy)
|
||||
import Data.Function (on)
|
||||
--import Control.Monad.State
|
||||
--import System.Random
|
||||
{-
|
||||
A simple rectangular room with a light in the center.
|
||||
Creates links and pathfinding graph.
|
||||
@@ -58,3 +60,4 @@ makeRect x y = [((0,0),(x,0))
|
||||
linksAndPath :: [(Point2,Float)] -> [(Point2,Point2)] -> [(Point2,Point2)]
|
||||
linksAndPath lnks subpth = subpth ++ concatMap linkClosest lnks
|
||||
where linkClosest (p,_) = doublePair (p, head $ sortBy (compare `on` dist p) $ map fst subpth)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user