pioneers/src/Map/Types.hs

73 lines
2.0 KiB
Haskell
Raw Normal View History

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
type PlayMap = Array (XCoord, ZCoord) Node
2014-02-09 20:18:03 +01:00
type XCoord = Int
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
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
deriving (Show, Eq)
2014-02-08 12:01:40 +01:00
-- | What resources can be harvested here?
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?
type StorInfo = [(Commodity,Amount)]
2014-02-08 12:01:40 +01:00
-- | What kind of structures may be erected here?
data BuildInfo = BStruc Structure
| BNothing
2014-02-08 12:01:40 +01:00
| BFlag
| BMine
2014-02-08 12:01:40 +01:00
| BSmall
| BMedium
| BLarge
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
deriving (Show, Eq)
2014-02-08 12:01:40 +01:00
2014-02-09 20:18:03 +01:00
-- TODO: Record Syntax
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)