Start adding machines for storing/distributing items

This commit is contained in:
2025-12-08 22:37:43 +00:00
parent 9e98cdc34b
commit 8b028c7f94
12 changed files with 251 additions and 181 deletions
+4
View File
@@ -1,6 +1,9 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.AmmoType where
import Data.Aeson
import Data.Aeson.TH
data AmmoType
= LauncherAmmo
@@ -12,3 +15,4 @@ data AmmoType
| PrintMaterial
| ExplosivePutty
deriving (Eq, Ord, Show, Read) --Generic, Flat)
deriveJSON defaultOptions ''AmmoType
+1 -1
View File
@@ -22,7 +22,7 @@ data Block = Block
, _blWallIDs :: IS.IntSet
, _blHP :: Int
, _blShadows :: [Int] -- a list of walls that are not shown when this block exists
, _blFootprint :: [Point2] -- TODO check whether this should be clockwise/anticlockwise
, _blFootprint :: [Point2] --clockwise!
, _blPos :: Point2
, _blDir :: Float
, _blHeight :: Float
+15 -2
View File
@@ -1,4 +1,5 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Machine (
@@ -11,6 +12,8 @@ module Dodge.Data.Machine (
module Dodge.Data.GenParams,
) where
import ShortShow
import Dodge.Data.AmmoType
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -43,10 +46,20 @@ data MachineType
| McDamSensor DamageSensor
| McProxSensor ProximitySensor
| McTurret {_mctTurret :: Turret}
-- | McStorage
-- | McDistributer
| McStorage {_mcsType :: AmmoType, _mcsAmount :: Int}
| McDistributer {_mcdStorageMachine :: Maybe Int}
-- | McSynthesiser
instance ShortShow MachineType where
shortShow = \case
McStatic -> "McStatic"
McTerminal -> "McTerm"
McDamSensor {} -> "McDamSen"
McProxSensor {} -> "McProxSen"
McTurret {} -> "McTur"
McStorage {} -> "McStor"
McDistributer {} -> "McDist"
data Turret = Turret
{ _tuWeapon :: Int
, _tuTurnSpeed :: Float