Add 8-way cardinal/intercardinal datatype

This commit is contained in:
2024-10-18 12:39:46 +01:00
parent d256bc0443
commit 8b6f5529ff
12 changed files with 267 additions and 157 deletions
+12 -1
View File
@@ -5,7 +5,18 @@ data CardinalPoint
| East
| South
| West
deriving (Eq, Ord, Show)
deriving (Eq, Ord, Show, Bounded, Enum)
data CardinalEightPoint
= North8
| NorthEast8
| East8
| SouthEast8
| South8
| SouthWest8
| West8
| NorthWest8
deriving (Eq, Ord, Show, Bounded, Enum)
data CardinalCover
= NSEW
+8 -1
View File
@@ -19,9 +19,15 @@ data HUDElement
}
| DisplayCarte
data MouseInventorySelection = NoMouseSel
| MouseInvSelect
{_misSelStart :: (Int,Int), _misMaybeEnd :: Maybe (Int,Int)}
| MouseInvChosen
{_misChosenStart :: (Int,Int), _misChosenEnd :: (Int,Int)}
data SubInventory
= NoSubInventory
{ _nsSelected :: Maybe (Int,Int)
{ _nsSelected :: MouseInventorySelection
, _nsMouseOver :: Maybe (Int,Int)
}
| ExamineInventory
@@ -44,3 +50,4 @@ data HUD = HUD
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
makeLenses ''MouseInventorySelection