(minor) Nodes now have record syntax

This commit is contained in:
Jonas Betzendahl 2014-09-14 14:36:44 +02:00
parent 28e5f47596
commit 2a9de00213
2 changed files with 10 additions and 8 deletions

View File

@ -85,7 +85,3 @@ gaussMountain seed mp = aplByPlace (liftUp c) (\(_,_) -> True) mp
liftUp (gx,gz) (Node (x,z) (rx,rz,y) _ b pl pa r s) = let y_neu = max y e liftUp (gx,gz) (Node (x,z) (rx,rz,y) _ b pl pa r s) = let y_neu = max y e
in Node (x,z) (rx, rz, y_neu) (htt GrassIslandMap y_neu) b pl pa r s in Node (x,z) (rx, rz, y_neu) (htt GrassIslandMap y_neu) b pl pa r s
where e = gauss3Dgeneral amp (fromIntegral gx) (fromIntegral gz) sig sig rx rz where e = gauss3Dgeneral amp (fromIntegral gx) (fromIntegral gz) sig sig rx rz
-- | Makes sure the edges of the Map are mountain-free
makeIsland :: PlayMap -> PlayMap
makeIsland = undefined -- tomorrow....

View File

@ -11,6 +11,16 @@ type XCoord = Double
type ZCoord = Double type ZCoord = Double
type YCoord = Double type YCoord = Double
data Node = Node { mapCoordinates :: (Xindex, Zindex)
, actualCoordinates :: (XCoord, ZCoord, YCoord)
, tiletype :: TileType
, buildinfo :: BuildInfo
, playerinfo :: PlayerInfo
, pathinfo :: PathInfo
, resinfo :: ResInfo
, storinfo :: StorInfo
} deriving (Show)
data MapType = GrassIslandMap data MapType = GrassIslandMap
| DesertMap | DesertMap
@ -66,10 +76,6 @@ data TileType = Ocean
| Mountain -- ^ Not accessible | Mountain -- ^ Not accessible
deriving (Show, Eq) deriving (Show, Eq)
-- TODO: Record Syntax?
data Node = Node (Xindex, Zindex) (XCoord, ZCoord, YCoord) TileType BuildInfo PlayerInfo PathInfo ResInfo StorInfo
deriving (Show)
data Structure = Flag -- Flag data Structure = Flag -- Flag
| Woodcutter -- Huts | Woodcutter -- Huts
| Forester | Forester