2018-03-03 16:03:17 +00:00
|
|
|
module Types.Interior where
|
|
|
|
|
|
|
|
import Data.Matrix as M
|
|
|
|
|
2018-04-02 14:29:35 +00:00
|
|
|
import Linear.V2
|
|
|
|
|
2018-03-03 16:03:17 +00:00
|
|
|
-- internal imports
|
|
|
|
|
|
|
|
import Types.Map
|
|
|
|
import Types.UserData
|
2018-04-14 16:43:05 +00:00
|
|
|
import Types.ReachPoint
|
2018-03-03 16:03:17 +00:00
|
|
|
|
|
|
|
data Cluster
|
|
|
|
= ClusterBox1
|
2018-04-03 20:21:07 +00:00
|
|
|
| ClusterTable1
|
|
|
|
| ClusterTable2
|
2018-04-03 20:27:41 +00:00
|
|
|
| ClusterTable3
|
|
|
|
| ClusterTable4
|
2018-03-31 21:22:10 +00:00
|
|
|
| ClusterCornerTable
|
2018-04-01 02:51:15 +00:00
|
|
|
| ClusterTableGroup
|
2018-03-03 16:03:17 +00:00
|
|
|
deriving (Enum, Bounded)
|
|
|
|
|
|
|
|
clusterMat :: Cluster -> Matrix (Maybe ImgId)
|
|
|
|
clusterMat ClusterBox1 =
|
|
|
|
M.fromLists
|
2018-03-05 20:11:38 +00:00
|
|
|
-- [ [ Nothing]
|
|
|
|
[ [Just ImgMiscBox1]
|
|
|
|
-- , [Nothing, Nothing, Nothing]
|
2018-03-03 16:03:17 +00:00
|
|
|
]
|
2018-04-03 20:21:07 +00:00
|
|
|
clusterMat ClusterTable1 =
|
|
|
|
M.fromLists
|
|
|
|
[[Just ImgEmpty, Just ImgMiscTable1]]
|
|
|
|
clusterMat ClusterTable2 =
|
|
|
|
M.fromLists
|
|
|
|
[ [Just ImgMiscTable2]
|
|
|
|
, [Just ImgEmpty]
|
|
|
|
]
|
2018-04-03 20:27:41 +00:00
|
|
|
clusterMat ClusterTable3 =
|
|
|
|
M.fromLists
|
2018-04-11 18:01:41 +00:00
|
|
|
[[Just ImgMiscTable3, Just ImgEmpty]]
|
2018-04-03 20:27:41 +00:00
|
|
|
clusterMat ClusterTable4 =
|
|
|
|
M.fromLists
|
|
|
|
[ [Just ImgEmpty]
|
2018-04-11 18:01:41 +00:00
|
|
|
, [Just ImgMiscTable4]
|
2018-04-03 20:27:41 +00:00
|
|
|
]
|
2018-03-31 21:22:10 +00:00
|
|
|
clusterMat ClusterCornerTable =
|
|
|
|
M.fromLists
|
2018-04-02 14:29:35 +00:00
|
|
|
[ [Just ImgMiscTable2, Just ImgMiscTableCorner]
|
|
|
|
, [Just ImgEmpty , Just ImgMiscTable1]
|
2018-04-01 02:51:15 +00:00
|
|
|
]
|
|
|
|
clusterMat ClusterTableGroup =
|
|
|
|
M.fromLists
|
|
|
|
[ [ Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
|
|
|
|
, Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
|
|
|
|
]
|
|
|
|
, [ Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
|
|
|
|
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
|
|
|
|
]
|
|
|
|
, [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
|
|
|
|
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
|
|
|
|
]
|
|
|
|
, [ Nothing, Nothing, Nothing
|
|
|
|
, Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
|
|
|
|
]
|
|
|
|
, [ Nothing, Nothing, Nothing
|
|
|
|
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
|
|
|
|
]
|
2018-03-31 21:22:10 +00:00
|
|
|
]
|
2018-03-03 16:03:17 +00:00
|
|
|
|
|
|
|
clusterRoom :: Cluster -> TileState
|
|
|
|
clusterRoom ClusterBox1 = Offi
|
2018-04-03 20:21:07 +00:00
|
|
|
clusterRoom ClusterTable1 = Offi
|
|
|
|
clusterRoom ClusterTable2 = Offi
|
2018-04-03 20:27:41 +00:00
|
|
|
clusterRoom ClusterTable3 = Offi
|
|
|
|
clusterRoom ClusterTable4 = Offi
|
2018-03-31 21:22:10 +00:00
|
|
|
clusterRoom ClusterCornerTable = Offi
|
2018-04-01 02:51:15 +00:00
|
|
|
clusterRoom ClusterTableGroup = Offi
|
2018-03-03 16:03:17 +00:00
|
|
|
|
2018-04-02 14:29:35 +00:00
|
|
|
clusterPoints :: Cluster -> [ReachPoint]
|
|
|
|
clusterPoints ClusterBox1 = []
|
2018-04-03 20:21:07 +00:00
|
|
|
clusterPoints ClusterTable1 =
|
|
|
|
[ ReachPoint Table (V2 1 1) ]
|
|
|
|
clusterPoints ClusterTable2 =
|
|
|
|
[ ReachPoint Table (V2 2 1) ]
|
2018-04-03 20:27:41 +00:00
|
|
|
clusterPoints ClusterTable3 =
|
|
|
|
[ ReachPoint Table (V2 1 2) ]
|
|
|
|
clusterPoints ClusterTable4 =
|
|
|
|
[ ReachPoint Table (V2 1 1) ]
|
2018-04-02 14:29:35 +00:00
|
|
|
clusterPoints ClusterCornerTable =
|
|
|
|
[ ReachPoint Table (V2 2 1)
|
|
|
|
]
|
|
|
|
clusterPoints ClusterTableGroup =
|
|
|
|
[ ReachPoint Table (V2 2 2)
|
|
|
|
, ReachPoint Table (V2 2 5)
|
|
|
|
, ReachPoint Table (V2 5 5)
|
|
|
|
]
|
|
|
|
|
2018-03-03 16:03:17 +00:00
|
|
|
instance Size Cluster where
|
|
|
|
size c =
|
|
|
|
let mat = clusterMat c
|
|
|
|
in fromIntegral ((nrows mat) * (ncols mat))
|