Add newtype to floor item ids
This commit is contained in:
@@ -2,18 +2,34 @@
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE EmptyDataDeriving #-}
|
||||
module Dodge.Data.Item.Location where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import NewInt
|
||||
|
||||
-- it would be nice to have these as empty types, but I'm not sure how to get
|
||||
-- aeson to handle that
|
||||
data FloorInt = FloorInt
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
-- should use these..
|
||||
data InvInt = InvInt
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
data TurretInt
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
data CrInt = CrInt
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
|
||||
data ItemLocation
|
||||
= InInv {_ilCrID :: Int, _ilInvID :: Int, _ilIsRoot :: Bool, _ilIsSelected :: Bool}
|
||||
| OnTurret {_ilTuID :: Int}
|
||||
| OnFloor {_ilFlID :: Int}
|
||||
| OnFloor {_ilFlID :: NewInt FloorInt}
|
||||
| InVoid
|
||||
deriving (Eq, Show, Ord, Read) --Generic, Flat)
|
||||
|
||||
makeLenses ''ItemLocation
|
||||
deriveJSON defaultOptions ''InvInt
|
||||
deriveJSON defaultOptions ''FloorInt
|
||||
deriveJSON defaultOptions ''ItemLocation
|
||||
|
||||
Reference in New Issue
Block a user