Safe Haskell | None |
---|---|
Language | Haskell2010 |
Item slots for UI and AI item collections.
Synopsis
- data SlotChar = SlotChar {
- slotPrefix :: Int
- slotChar :: Char
- newtype ItemSlots = ItemSlots (EnumMap SLore SingleItemSlots)
- type SingleItemSlots = EnumMap SlotChar ItemId
- allSlots :: [SlotChar]
- intSlots :: [SlotChar]
- slotLabel :: SlotChar -> Text
- assignSlot :: SingleItemSlots -> SlotChar
- sortSlotMap :: (ItemId -> ItemFull) -> SingleItemSlots -> SingleItemSlots
- mergeItemSlots :: (ItemId -> ItemFull) -> [SingleItemSlots] -> SingleItemSlots
Documentation
Slot label. Usually just a character. Sometimes with a numerical prefix.
SlotChar | |
|
Instances
Enum SlotChar Source # | |
Defined in Game.LambdaHack.Client.UI.ItemSlot | |
Eq SlotChar Source # | |
Ord SlotChar Source # | |
Defined in Game.LambdaHack.Client.UI.ItemSlot | |
Show SlotChar Source # | |
Binary SlotChar Source # | |
A collection of mappings from slot labels to item identifiers.
assignSlot :: SingleItemSlots -> SlotChar Source #
Assigns a slot to an item, e.g., for inclusion in equipment of a hero. At first, e.g., when item is spotted on the floor, the slot is not user-friendly. After any player's item manipulation action, slots are sorted and a fully human-readable slot is then assigned. Only then the slot can be viewed by the player.
sortSlotMap :: (ItemId -> ItemFull) -> SingleItemSlots -> SingleItemSlots Source #
mergeItemSlots :: (ItemId -> ItemFull) -> [SingleItemSlots] -> SingleItemSlots Source #