Added Creation and StaticMaps modules

This commit is contained in:
Jonas Betzendahl 2014-02-09 20:18:03 +01:00
parent 2b2417f37d
commit 58a598da8e
3 changed files with 26 additions and 6 deletions

7
src/Map/Creation.hs Normal file
View File

@ -0,0 +1,7 @@
module Map.Creation
where
import Map.Types
newMap :: Int -> Int -> PlayMap
newMap = undefined

9
src/Map/StaticMaps.hs Normal file
View File

@ -0,0 +1,9 @@
module Map.StaticMaps
where
import Map.Types
import Data.Array
emptyMap :: PlayMap
emptyMap = array ((0,0), (100,100)) [((a,b), (Minimal (a,b) 0.5)) | a <- [0..100], b <- [0..100]]

View File

@ -3,11 +3,13 @@ where
import PioneerTypes
newtype XCoord = XCoord Int
newtype YCoord = YCoord Int
newtype ZCoord = ZCoord Float
import Data.Array
newtype Coord = Coord (XCoord, YCoord, ZCoord)
type PlayMap = Array (XCoord, YCoord) Node
type XCoord = Int
type YCoord = Int
type ZCoord = Float
-- | Ownership information, Parameter to occupied is player number
data PlayerInfo = NoPlayer
@ -40,5 +42,7 @@ data TileType = Ocean
| Mountain -- ^ Not accessible
deriving (Eq)
data Node = Full Coord TileType BuildInfo PlayerInfo PathInfo ResInfo StorInfo
| Minimal Coord
-- TODO: Record Syntax
data Node = Full (XCoord, YCoord) ZCoord TileType BuildInfo PlayerInfo PathInfo ResInfo StorInfo
| Minimal (XCoord, YCoord) ZCoord -- defaults to empty green grass node on height 0.5