Continue refactoring reloading

This commit is contained in:
2022-06-21 13:06:55 +01:00
parent 37eb69c661
commit 14a7189b44
12 changed files with 80 additions and 60 deletions
+7 -17
View File
@@ -216,9 +216,7 @@ data SubInventory
| CombineInventory {_combineInvSel :: Maybe Int}
| InspectInventory
| LockedInventory
| DisplayTerminal
{_termID :: Int
}
| DisplayTerminal {_termID :: Int }
-- deriving (Eq,Ord,Show)
data HUD = HUD
@@ -349,6 +347,7 @@ data Creature = Creature
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: Int
, _crInvSelAction :: InvSelAction
, _crInvCapacity :: Int
, _crInvLock :: Bool
, _crInvEquipped :: IM.IntMap EquipPosition
@@ -488,7 +487,7 @@ data ItemConsumption
, _laMax :: Int
, _laLoaded :: Int
, _laCycle :: [LoadAction]
, _laProgress :: LoadProgress
, _laProgress :: Maybe [LoadAction]
}
| ChargeableAmmo
{ _wpMaxCharge :: Int
@@ -546,22 +545,14 @@ data ItemPortage
| WornItem
| NoPortage
data LoadActionProgress = LoadActionProgress
{ _actionProgress :: Int
, _actionType :: LoadAction
}
deriving (Eq,Ord,Show)
data LoadProgress
= InProgress { _lastAction :: Maybe LoadAction, _futureActions :: [LoadActionProgress] }
| FinishedLoading
deriving (Eq,Ord,Show)
data LoadAction
= Eject {_actionTime :: Int}
| Insert {_actionTime :: Int, _insertMax :: Maybe Int }
| Prime {_actionTime :: Int}
deriving (Eq,Ord,Show)
data InvSelAction
= NoInvSelAction
| ReloadAction { _actionProgress :: Int, _reloadAction :: LoadAction }
-- I believe this is called every frame, not sure when though
data ItEffect
@@ -1487,8 +1478,7 @@ makeLenses ''FloorItem
makeLenses ''ItemConsumption
makeLenses ''AmmoType
makeLenses ''LoadAction
makeLenses ''LoadActionProgress
makeLenses ''LoadProgress
makeLenses ''InvSelAction
makeLenses ''TweakParam
makeLenses ''Prop
makeLenses ''Modification