Start adding machines for storing/distributing items
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user