Make lasGun have multiple functions when attached differently
This commit is contained in:
@@ -23,6 +23,7 @@ data ComposeLinkType
|
||||
| WeaponTargetingLink
|
||||
| RemoteScreenLink
|
||||
| AugmentedHUDLink
|
||||
| FunctionChangeLink
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ItemStructuralFunction
|
||||
@@ -37,28 +38,36 @@ data ItemStructuralFunction
|
||||
| AmmoTargetingSF AmmoType
|
||||
| AmmoPayloadSF AmmoType
|
||||
| AmmoEffectSF AmmoType
|
||||
| FunctionChangeSF
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
type PartiallyComposedItem lt = (Item, ItemStructuralFunction, LinkTest lt)
|
||||
type ComposedItem = (Item, ItemStructuralFunction)
|
||||
type PartiallyComposedItem = (Item, ItemStructuralFunction, LinkTest)
|
||||
|
||||
data ComposedItem = CItem
|
||||
{ _cItem :: Item
|
||||
, _cItemFunction :: ItemStructuralFunction
|
||||
}
|
||||
|
||||
data ItemLink = ILink
|
||||
{ _iatType :: ComposeLinkType
|
||||
, _iatOrient :: Item -> ComposeLinkType -> Item -> (Point3, Quaternion Float)
|
||||
}
|
||||
|
||||
data LinkTest lt = LTest
|
||||
{ _tryLeftLink :: PartiallyComposedItem lt -> Maybe (LinkUpdate lt)
|
||||
, _tryRightLink :: PartiallyComposedItem lt -> Maybe (LinkUpdate lt)
|
||||
data LinkTest = LTest
|
||||
{ _tryLeftLink :: PartiallyComposedItem -> Maybe LinkUpdate
|
||||
, _tryRightLink :: PartiallyComposedItem -> Maybe LinkUpdate
|
||||
}
|
||||
|
||||
data LinkUpdate lt = LUpdate
|
||||
{ _luLinkType :: lt
|
||||
, _luParentUpdate :: PartiallyComposedItem lt -> PartiallyComposedItem lt
|
||||
, _luChildUpdate :: PartiallyComposedItem lt -> PartiallyComposedItem lt
|
||||
data LinkUpdate = LUpdate
|
||||
{ _luLinkType :: ItemLink
|
||||
, _luParentUpdate :: PartiallyComposedItem -> PartiallyComposedItem
|
||||
, _luChildUpdate :: PartiallyComposedItem -> PartiallyComposedItem
|
||||
}
|
||||
|
||||
makeLenses ''ComposedItem
|
||||
makeLenses ''ItemLink
|
||||
makeLenses ''LinkTest
|
||||
makeLenses ''LinkUpdate
|
||||
deriveJSON defaultOptions ''ItemStructuralFunction
|
||||
deriveJSON defaultOptions ''ComposedItem
|
||||
deriveJSON defaultOptions ''ComposeLinkType
|
||||
|
||||
Reference in New Issue
Block a user