Cleanup, prepare ground to allow for drawing attached items
This commit is contained in:
@@ -1,28 +1,30 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.ComposedItem
|
||||
where
|
||||
module Dodge.Data.ComposedItem where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
-- it would be nice not to have to import the following...
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Geometry.Data
|
||||
import Linear.Quaternion (Quaternion (..))
|
||||
|
||||
data ComposeLinkType
|
||||
data ComposeLinkType
|
||||
= AmmoInLink Int AmmoType
|
||||
| AmmoModLink
|
||||
| AmmoTargetingLink
|
||||
| AmmoPayloadLink
|
||||
| AmmoEffectLink
|
||||
| WeaponScopeLink
|
||||
| WeaponTargetingLink
|
||||
| WeaponScopeLink
|
||||
| WeaponTargetingLink
|
||||
| RemoteScreenLink
|
||||
| AugmentedHUDLink
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ItemStructuralFunction
|
||||
= WeaponPlatformSF
|
||||
@@ -36,21 +38,25 @@ data ItemStructuralFunction
|
||||
| AmmoTargetingSF AmmoType
|
||||
| AmmoPayloadSF AmmoType
|
||||
| AmmoEffectSF AmmoType
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
type PartiallyComposedItem = (Item, ItemStructuralFunction, LinkTest)
|
||||
type PartiallyComposedItem lt = (Item, ItemStructuralFunction, LinkTest lt)
|
||||
|
||||
data LinkTest = LinkTest
|
||||
{ _tryLeftLink :: PartiallyComposedItem -> Maybe LinkUpdate
|
||||
, _tryRightLink :: PartiallyComposedItem -> Maybe LinkUpdate
|
||||
data ItemAttachment = IAttach
|
||||
{ _iatType :: ComposeLinkType
|
||||
, _iatOrient :: Item -> Item -> Maybe (Point3, Quaternion Float)
|
||||
}
|
||||
|
||||
data LinkUpdate = LinkUpdate
|
||||
{ _luLinkType :: ComposeLinkType
|
||||
, _luParentUpdate :: PartiallyComposedItem -> PartiallyComposedItem
|
||||
, _luChildUpdate :: PartiallyComposedItem -> PartiallyComposedItem
|
||||
data LinkTest lt = LTest
|
||||
{ _tryLeftLink :: PartiallyComposedItem lt -> Maybe (LinkUpdate lt)
|
||||
, _tryRightLink :: PartiallyComposedItem lt -> Maybe (LinkUpdate lt)
|
||||
}
|
||||
|
||||
data LinkUpdate lt = LUpdate
|
||||
{ _luLinkType :: lt
|
||||
, _luParentUpdate :: PartiallyComposedItem lt -> PartiallyComposedItem lt
|
||||
, _luChildUpdate :: PartiallyComposedItem lt -> PartiallyComposedItem lt
|
||||
}
|
||||
|
||||
makeLenses ''LinkTest
|
||||
makeLenses ''LinkUpdate
|
||||
|
||||
Reference in New Issue
Block a user