2014-02-08 12:01:40 +01:00
|
|
|
module Map.Types
|
|
|
|
where
|
|
|
|
|
|
|
|
import PioneerTypes
|
|
|
|
|
2014-02-09 20:18:03 +01:00
|
|
|
import Data.Array
|
2014-02-08 12:01:40 +01:00
|
|
|
|
2014-02-11 12:56:24 +01:00
|
|
|
type PlayMap = Array (XCoord, ZCoord) Node
|
2014-02-09 20:18:03 +01:00
|
|
|
|
|
|
|
type XCoord = Int
|
2014-02-11 12:56:24 +01:00
|
|
|
type ZCoord = Int
|
|
|
|
type YCoord = Float
|
|
|
|
|
|
|
|
data MapType = GrassIslandMap
|
|
|
|
| DesertMap
|
2014-02-08 12:01:40 +01:00
|
|
|
|
|
|
|
-- | Ownership information, Parameter to occupied is player number
|
|
|
|
data PlayerInfo = NoPlayer
|
|
|
|
| Occupied Int
|
|
|
|
|
2014-02-11 12:56:24 +01:00
|
|
|
instance Show PlayerInfo where
|
|
|
|
show (NoPlayer) = "not occupied"
|
|
|
|
show (Occupied i) = "occupied by player " ++ (show i)
|
|
|
|
|
2014-02-08 12:01:40 +01:00
|
|
|
-- | Path info, is this node part of a path?
|
|
|
|
data PathInfo = NoPath
|
|
|
|
| Path
|
|
|
|
| Border
|
2014-02-11 12:56:24 +01:00
|
|
|
deriving (Show, Eq)
|
2014-02-08 12:01:40 +01:00
|
|
|
|
|
|
|
-- | What resources can be harvested here?
|
2014-02-11 12:56:24 +01:00
|
|
|
data ResInfo = Plain
|
|
|
|
| ResInfo Resource Amount
|
|
|
|
|
|
|
|
instance Show ResInfo where
|
|
|
|
show (Plain) = "no resources"
|
|
|
|
show (ResInfo res amt) = "Resource: " ++ (show res) ++ "," ++ (show amt)
|
2014-02-08 12:01:40 +01:00
|
|
|
|
|
|
|
-- | What commodities are currently stored here?
|
2014-02-11 12:56:24 +01:00
|
|
|
type StorInfo = [(Commodity,Amount)]
|
2014-02-08 12:01:40 +01:00
|
|
|
|
|
|
|
-- | What kind of structures may be erected here?
|
2014-02-11 12:56:24 +01:00
|
|
|
data BuildInfo = BStruc Structure
|
|
|
|
| BNothing
|
2014-02-08 12:01:40 +01:00
|
|
|
| BFlag
|
2014-02-11 12:56:24 +01:00
|
|
|
| BMine
|
2014-02-08 12:01:40 +01:00
|
|
|
| BSmall
|
|
|
|
| BMedium
|
|
|
|
| BLarge
|
|
|
|
|
2014-02-11 12:56:24 +01:00
|
|
|
instance Show BuildInfo where
|
|
|
|
show (BStruc s) = "Structure: " ++ (show s)
|
|
|
|
show (BNothing) = "no Structure possible"
|
|
|
|
show (BFlag) = "only flags possible"
|
|
|
|
show (BMine) = "mines possible"
|
|
|
|
show (BSmall) = "small buildings possible"
|
|
|
|
show (BMedium) = "medium buildings possible"
|
|
|
|
show (BLarge) = "large buildings possible"
|
|
|
|
|
2014-02-08 12:01:40 +01:00
|
|
|
data TileType = Ocean
|
|
|
|
| Beach
|
|
|
|
| Grass
|
|
|
|
| Desert
|
|
|
|
| Lake
|
|
|
|
| Hill -- ^ Accessible
|
|
|
|
| Mountain -- ^ Not accessible
|
2014-02-11 12:56:24 +01:00
|
|
|
deriving (Show, Eq)
|
2014-02-08 12:01:40 +01:00
|
|
|
|
2014-02-09 20:18:03 +01:00
|
|
|
-- TODO: Record Syntax
|
2014-02-11 12:56:24 +01:00
|
|
|
data Node = Full (XCoord, ZCoord) YCoord TileType BuildInfo PlayerInfo PathInfo ResInfo StorInfo
|
|
|
|
| Minimal (XCoord, ZCoord) YCoord -- defaults to empty green grass node on height 0.5
|
|
|
|
deriving (Show)
|