Add Binary instances

This commit is contained in:
2022-08-21 10:58:19 +01:00
parent 386a2b4732
commit 1ce7d4a72d
95 changed files with 345 additions and 3 deletions
+6
View File
@@ -5,6 +5,7 @@
module Dodge.Data.Creature.State where
import Data.Binary
import Flat
import Color
import Control.Lens
@@ -20,17 +21,20 @@ data CreatureState = CrSt
, _csDropsOnDeath :: CreatureDropType
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary CreatureState
data CreatureDropType
= DropAll
| DropAmount Int
| DropSpecific [Int]
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary CreatureDropType
data CrSpState
= Barrel {_piercedPoints :: [Point2]}
| GenCr
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary CrSpState
data Faction
= GenericFaction Int
@@ -42,6 +46,7 @@ data Faction
| ColorFaction Color
| PlayerFaction
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Faction
data CrGroup
= LoneWolf
@@ -52,6 +57,7 @@ data CrGroup
| CrGroupID {_crGroupID :: Int}
| ShieldGroup
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary CrGroup
makeLenses ''CreatureState
makeLenses ''CrSpState