{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
module Aztecs.ECS.Component
( ComponentID (..),
Component (..),
)
where
import Aztecs.ECS.Access.Internal (Access)
import Aztecs.ECS.Component.Internal (ComponentID (..))
import Aztecs.ECS.Entity
import Aztecs.ECS.World.Storage
import Data.Typeable
import Data.Vector (Vector)
class (Monad m, Typeable a, Storage a (StorageT a)) => Component m a where
type StorageT a
type StorageT a = Vector a
componentOnInsert :: EntityID -> a -> Access m ()
componentOnInsert EntityID
_ a
_ = () -> Access m ()
forall a. a -> Access m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
{-# INLINEABLE componentOnInsert #-}
componentOnChange :: EntityID -> a -> Access m ()
componentOnChange EntityID
_ a
_ = () -> Access m ()
forall a. a -> Access m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
{-# INLINEABLE componentOnChange #-}
componentOnRemove :: EntityID -> a -> Access m ()
componentOnRemove EntityID
_ a
_ = () -> Access m ()
forall a. a -> Access m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
{-# INLINEABLE componentOnRemove #-}