This commit is contained in:
2022-07-27 12:49:23 +01:00
parent 6554d219dc
commit 8d17ce66e9
106 changed files with 2911 additions and 2678 deletions
+77 -66
View File
@@ -1,88 +1,99 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Creature
( module Dodge.Data.Creature
, module Dodge.Data.Creature.Misc
, module Dodge.Data.Creature.State
, module Dodge.Data.Creature.Perception
, module Dodge.Data.Creature.Memory
, module Dodge.Data.Creature.Stance
) where
import GHC.Generics
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Creature (
module Dodge.Data.Creature,
module Dodge.Data.Creature.Misc,
module Dodge.Data.Creature.State,
module Dodge.Data.Creature.Perception,
module Dodge.Data.Creature.Memory,
module Dodge.Data.Creature.Stance,
) where
import Control.Lens
import Data.Aeson
import qualified Data.Map.Strict as M
import Dodge.Data.ActionPlan
import Dodge.Data.Creature.Memory
import Dodge.Data.Creature.Misc
import Dodge.Data.Creature.Perception
import Dodge.Data.Creature.Stance
import Dodge.Data.Creature.State
import Dodge.Data.Hammer
import Dodge.Data.Item
import Dodge.Data.LoadAction
import Dodge.Data.Material
import Dodge.Data.ActionPlan
import Dodge.Data.Hammer
import Dodge.Data.Creature.Perception
import Dodge.Data.Creature.Memory
import Dodge.Data.Creature.Stance
import GHC.Generics
import Geometry.Data
import qualified IntMapHelp as IM
import qualified Data.Map.Strict as M
import Control.Lens
data Creature = Creature
{ _crPos :: Point2
, _crOldPos :: Point2
, _crVel :: Point2
, _crDir :: Float
, _crOldDir :: Float
, _crMvDir :: Float
, _crTwist :: Float
, _crType :: CreatureType
, _crID :: Int
, _crRad :: Float
, _crMass :: Float
, _crHP :: Int
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: InvSel
, _crInvCapacity :: Int
, _crInvLock :: Bool
, _crInvEquipped :: IM.IntMap EquipPosition
, _crEquipment :: M.Map EquipPosition Int
, _crLeftInvSel :: Maybe Int
, _crState :: CreatureState
, _crCorpse :: CreatureCorpse --Creature -> Corpse -> SPic
, _crMaterial :: Material
, _crPastDamage :: Int
, _crStance :: Stance
, _crActionPlan :: ActionPlan
, _crMeleeCooldown :: Int
, _crPerception :: Perception
, _crMemory :: Memory
, _crVocalization :: Vocalization
, _crFaction :: Faction
, _crGroup :: CrGroup
, _crIntention :: Intention
, _crMvType :: CrMvType
{ _crPos :: Point2
, _crOldPos :: Point2
, _crVel :: Point2
, _crDir :: Float
, _crOldDir :: Float
, _crMvDir :: Float
, _crTwist :: Float
, _crType :: CreatureType
, _crID :: Int
, _crRad :: Float
, _crMass :: Float
, _crHP :: Int
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: InvSel
, _crInvCapacity :: Int
, _crInvLock :: Bool
, _crInvEquipped :: IM.IntMap EquipPosition
, _crEquipment :: M.Map EquipPosition Int
, _crLeftInvSel :: Maybe Int
, _crState :: CreatureState
, _crCorpse :: CreatureCorpse --Creature -> Corpse -> SPic
, _crMaterial :: Material
, _crPastDamage :: Int
, _crStance :: Stance
, _crActionPlan :: ActionPlan
, _crMeleeCooldown :: Int
, _crPerception :: Perception
, _crMemory :: Memory
, _crVocalization :: Vocalization
, _crFaction :: Faction
, _crGroup :: CrGroup
, _crIntention :: Intention
, _crMvType :: CrMvType
, _crHammerPosition :: HammerPosition
, _crName :: String
, _crStatistics :: CreatureStatistics
, _crCamouflage :: CamouflageStatus
, _crName :: String
, _crStatistics :: CreatureStatistics
, _crCamouflage :: CamouflageStatus
}
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Creature where
deriving (Eq, Show, Read, Generic)
instance ToJSON Creature where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Creature
instance FromJSON Creature
data CreatureCorpse = MakeDefaultCorpse
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON CreatureCorpse where
deriving (Eq, Ord, Show, Read, Generic)
instance ToJSON CreatureCorpse where
toEncoding = genericToEncoding defaultOptions
instance FromJSON CreatureCorpse
instance FromJSON CreatureCorpse
data Intention = Intention
{ _targetCr :: Maybe Creature
, _mvToPoint :: Maybe Point2
, _viewPoint :: Maybe Point2
{ _targetCr :: Maybe Creature
, _mvToPoint :: Maybe Point2
, _viewPoint :: Maybe Point2
}
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Intention where
deriving (Eq, Show, Read, Generic)
instance ToJSON Intention where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Intention
instance FromJSON Intention
makeLenses ''Creature
makeLenses ''Intention