tracer/src/Types/Interior.hs

188 lines
5.4 KiB
Haskell
Raw Normal View History

2018-03-03 16:03:17 +00:00
module Types.Interior where
import Data.Matrix as M
import Linear.V2
2018-03-03 16:03:17 +00:00
-- internal imports
import Types.Map
2018-04-14 16:43:05 +00:00
import Types.ReachPoint
import Types.ImgId
import Types.Direction
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-07-21 04:43:26 +00:00
| ClusterCopier
2018-07-30 13:34:45 +00:00
| ClusterFlipchart
2018-07-30 19:10:42 +00:00
| ClusterConferenceTable1
| ClusterConferenceTable2
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
2018-07-21 18:37:01 +00:00
[[Just ImgEmpty, Just ImgMiscTable1]]
2018-04-03 20:21:07 +00:00
clusterMat ClusterTable2 =
M.fromLists
[ [Just ImgMiscTable2]
2018-07-21 18:37:01 +00:00
, [Just ImgEmpty]
2018-04-03 20:21:07 +00:00
]
2018-04-03 20:27:41 +00:00
clusterMat ClusterTable3 =
M.fromLists
2018-07-21 18:37:01 +00:00
[[Just ImgMiscTable3, Just ImgEmpty]]
2018-04-03 20:27:41 +00:00
clusterMat ClusterTable4 =
M.fromLists
2018-07-21 18:37:01 +00:00
[ [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
[ [Just ImgMiscTable2, Just ImgMiscTableCorner]
2018-07-21 18:37:01 +00:00
, [Just ImgEmpty, Just ImgMiscTable1]
2018-04-01 02:51:15 +00:00
]
clusterMat ClusterTableGroup =
M.fromLists
2018-07-21 18:37:01 +00:00
[ [ Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
, Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
2018-04-01 02:51:15 +00:00
]
2018-07-21 18:37:01 +00:00
, [ Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
2018-04-01 02:51:15 +00:00
]
2018-07-21 18:37:01 +00:00
, [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
2018-04-01 02:51:15 +00:00
]
, [ Nothing, Nothing, Nothing
2018-07-21 18:37:01 +00:00
, Just ImgEmpty, Just ImgMiscTable2, Just ImgMiscTableCorner
2018-04-01 02:51:15 +00:00
]
, [ Nothing, Nothing, Nothing
2018-07-21 18:37:01 +00:00
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable1
2018-04-01 02:51:15 +00:00
]
2018-03-31 21:22:10 +00:00
]
2018-07-21 04:43:26 +00:00
clusterMat ClusterCopier =
M.fromLists
2018-07-21 18:37:01 +00:00
[ [ Just ImgEmptyNoWalk]
, [ Just ImgEmpty]
2018-07-21 04:43:26 +00:00
]
2018-07-30 13:34:45 +00:00
clusterMat ClusterFlipchart =
M.fromLists
[ [ Just ImgMiscFlipchart]
, [ Just ImgEmpty]
]
2018-07-30 19:10:42 +00:00
clusterMat ClusterConferenceTable1 =
M.fromLists
[ [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTableC4, Just ImgMiscTable4, Just ImgMiscTable4
, Just ImgMiscTable4, Just ImgMiscTable4, Just ImgMiscTableC3, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTable1, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable3, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTable1, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgMiscTable3, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTableC1, Just ImgMiscTable2, Just ImgMiscTable2
, Just ImgMiscTable2, Just ImgMiscTable2, Just ImgMiscTableC2, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
]
]
clusterMat ClusterConferenceTable2 =
M.fromLists
[ [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTableC4, Just ImgMiscTable4
, Just ImgMiscTable4, Just ImgMiscTableC3, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTable1, Just ImgEmpty
, Just ImgEmpty, Just ImgMiscTable3, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgMiscTableC1, Just ImgMiscTable2
, Just ImgMiscTable2, Just ImgMiscTableC2, Just ImgEmpty
]
, [ Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
, Just ImgEmpty, Just ImgEmpty, Just ImgEmpty
]
]
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-07-21 04:43:26 +00:00
clusterRoom ClusterCopier = Offi
2018-07-30 13:34:45 +00:00
clusterRoom ClusterFlipchart = Offi
2018-07-30 19:10:42 +00:00
clusterRoom ClusterConferenceTable1 = Offi
clusterRoom ClusterConferenceTable2 = Offi
2018-03-03 16:03:17 +00:00
clusterPoints :: Cluster -> [ReachPoint]
clusterPoints ClusterBox1 = []
2018-04-03 20:21:07 +00:00
clusterPoints ClusterTable1 =
[ ReachPoint Table (V2 1 1) NE]
2018-04-03 20:21:07 +00:00
clusterPoints ClusterTable2 =
[ ReachPoint Table (V2 2 1) NW]
2018-04-03 20:27:41 +00:00
clusterPoints ClusterTable3 =
[ ReachPoint Table (V2 1 2) SW]
2018-04-03 20:27:41 +00:00
clusterPoints ClusterTable4 =
[ ReachPoint Table (V2 1 1) SE]
clusterPoints ClusterCornerTable =
2018-07-30 12:34:46 +00:00
[ ReachPoint Computer (V2 2 1) N
]
clusterPoints ClusterTableGroup =
2018-07-30 12:34:46 +00:00
[ ReachPoint Computer (V2 2 2) N
, ReachPoint Computer (V2 2 5) N
, ReachPoint Computer (V2 5 5) N
]
2018-07-21 04:43:26 +00:00
clusterPoints ClusterCopier =
[ ReachPoint Copier (V2 2 1) NW
]
2018-07-30 13:34:45 +00:00
clusterPoints ClusterFlipchart =
[ ReachPoint Table (V2 2 1) NW
]
2018-07-30 19:10:42 +00:00
clusterPoints ClusterConferenceTable1 =
[ ReachPoint Table (V2 1 3) SE
, ReachPoint Table (V2 1 4) SE
, ReachPoint Table (V2 1 5) SE
, ReachPoint Table (V2 1 6) SE
, ReachPoint Table (V2 3 1) NE
, ReachPoint Table (V2 3 8) SW
, ReachPoint Table (V2 4 1) NE
, ReachPoint Table (V2 4 8) SW
, ReachPoint Table (V2 6 3) NW
, ReachPoint Table (V2 6 4) NW
, ReachPoint Table (V2 6 5) NW
, ReachPoint Table (V2 6 6) NW
]
clusterPoints ClusterConferenceTable2 =
[ ReachPoint Table (V2 1 3) SE
, ReachPoint Table (V2 1 4) SE
, ReachPoint Table (V2 3 1) NE
, ReachPoint Table (V2 3 6) SW
, ReachPoint Table (V2 5 3) NW
, ReachPoint Table (V2 5 4) NW
]
2018-03-03 16:03:17 +00:00
instance Size Cluster where
size c =
let mat = clusterMat c
in fromIntegral ((nrows mat) * (ncols mat))