Add Binary instances
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
module Dodge.Data.ActionPlan where
|
||||
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -23,11 +24,13 @@ data ActionPlan
|
||||
, _apGoal :: [Goal]
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ActionPlan
|
||||
|
||||
data RandImpulse
|
||||
= RandImpulseList [Impulse]
|
||||
| RandImpulseCircMove Float
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary RandImpulse
|
||||
|
||||
data Impulse
|
||||
= Move Point2
|
||||
@@ -62,6 +65,7 @@ data Impulse
|
||||
}
|
||||
| ImpulseNothing
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Impulse
|
||||
|
||||
infixr 9 `WaitThen`
|
||||
|
||||
@@ -169,6 +173,7 @@ data Action
|
||||
, _mainAction :: Action
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Action
|
||||
|
||||
data Strategy
|
||||
= Flank Int
|
||||
@@ -187,12 +192,14 @@ data Strategy
|
||||
| Flee
|
||||
| MeleeStrike
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Strategy
|
||||
|
||||
data Goal
|
||||
= LiveLongAndProsper
|
||||
| Kill Int
|
||||
| SentinelAt Point2 Float
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Goal
|
||||
|
||||
deriveJSON defaultOptions ''ActionPlan
|
||||
deriveJSON defaultOptions ''RandImpulse
|
||||
|
||||
Reference in New Issue
Block a user