mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS

Description

This library contains the ECS used by the Mischief Game Engine.

Synopsis

Learn You an ECS for Great Mischief!

The official Mischief book.

You can read chapters and subchapters in any order. The Startup Guide (1.1) is heavily recommended if this is your first time using Mischief.

class (Typeable c, IsExclusive (IsExclusiveRel c)) => Component c where Source #

The Component typeclass.

Minimal complete definition

Nothing

Associated Types

type IsExclusiveRel c :: Bool Source #

Set whether the relationships this component is used in are exclusive or not.

Methods

required :: Set DefaultComponentType Source #

List of components required by this one. All required components must be Default

Example

data A = A
instance Component A where
  required = require @(B, C)

data B = B Int deriving (Component, Generic, Default)

data C = C String deriving (Component)
instance Default C where
  def = C "Default String"

onAdd :: [Hook c] Source #

onSet :: [Hook c] Source #

onRemove :: [Hook c] Source #

onAddRel :: [HookRel c] Source #

onSetRel :: [HookRel c] Source #

onRemoveRel :: [HookRel c] Source #

Instances

Instances details
Component FixedSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Associated Types

type IsExclusiveRel FixedSchedule 
Instance details

Defined in Mischief.ECS.App.Schedules

Component ScheduleLabel Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Associated Types

type IsExclusiveRel ScheduleLabel 
Instance details

Defined in Mischief.ECS.App.Schedules

Component Schedules Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Associated Types

type IsExclusiveRel Schedules 
Instance details

Defined in Mischief.ECS.App.Schedules

Component StartupSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Associated Types

type IsExclusiveRel StartupSchedule 
Instance details

Defined in Mischief.ECS.App.Schedules

Component UpdateSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Associated Types

type IsExclusiveRel UpdateSchedule 
Instance details

Defined in Mischief.ECS.App.Schedules

Component LastSystemTick Source # 
Instance details

Defined in Mischief.ECS.App.SystemDef

Associated Types

type IsExclusiveRel LastSystemTick 
Instance details

Defined in Mischief.ECS.App.SystemDef

Component SystemTick Source # 
Instance details

Defined in Mischief.ECS.App.SystemDef

Associated Types

type IsExclusiveRel SystemTick 
Instance details

Defined in Mischief.ECS.App.SystemDef

Component ScheduledIn Source # 
Instance details

Defined in Mischief.ECS.App.Systems

Associated Types

type IsExclusiveRel ScheduledIn 
Instance details

Defined in Mischief.ECS.App.Systems

Component SystemFunction Source # 
Instance details

Defined in Mischief.ECS.App.Systems

Associated Types

type IsExclusiveRel SystemFunction 
Instance details

Defined in Mischief.ECS.App.Systems

Component Systems Source # 
Instance details

Defined in Mischief.ECS.App.Systems

Associated Types

type IsExclusiveRel Systems 
Instance details

Defined in Mischief.ECS.App.Systems

Component ComponentArchetypes Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel ComponentArchetypes 
Instance details

Defined in Mischief.ECS.Components

Component ComponentPairs Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel ComponentPairs 
Instance details

Defined in Mischief.ECS.Components

Component ComponentType Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel ComponentType 
Instance details

Defined in Mischief.ECS.Components

Component DefaultValue Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel DefaultValue 
Instance details

Defined in Mischief.ECS.Components

Component IsExclusiveRelationship Source # 
Instance details

Defined in Mischief.ECS.Components

Component RequiredBy Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel RequiredBy 
Instance details

Defined in Mischief.ECS.Components

Component Requires Source # 
Instance details

Defined in Mischief.ECS.Components

Associated Types

type IsExclusiveRel Requires 
Instance details

Defined in Mischief.ECS.Components

Component Name Source # 
Instance details

Defined in Mischief.ECS.Components.Common

Associated Types

type IsExclusiveRel Name 
Instance details

Defined in Mischief.ECS.Components.Common

Component ComponentAddHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component ComponentAddHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component ComponentRemoveHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component ComponentRemoveHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component ComponentSetHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component ComponentSetHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

Component FixedExtra Source # 
Instance details

Defined in Mischief.ECS.Fixed

Associated Types

type IsExclusiveRel FixedExtra 
Instance details

Defined in Mischief.ECS.Fixed

Component FixedFrequency Source # 
Instance details

Defined in Mischief.ECS.Fixed

Associated Types

type IsExclusiveRel FixedFrequency 
Instance details

Defined in Mischief.ECS.Fixed

Component FixedTime Source # 
Instance details

Defined in Mischief.ECS.Fixed

Associated Types

type IsExclusiveRel FixedTime 
Instance details

Defined in Mischief.ECS.Fixed

Component ChildOf Source # 
Instance details

Defined in Mischief.ECS.Relationships.ChildOf

Associated Types

type IsExclusiveRel ChildOf 
Instance details

Defined in Mischief.ECS.Relationships.ChildOf

Component Before Source # 
Instance details

Defined in Mischief.ECS.Relationships.Order

Associated Types

type IsExclusiveRel Before 
Instance details

Defined in Mischief.ECS.Relationships.Order

Component Visited Source # 
Instance details

Defined in Mischief.ECS.Relationships.Order

Associated Types

type IsExclusiveRel Visited 
Instance details

Defined in Mischief.ECS.Relationships.Order

Component Repeater Source # 
Instance details

Defined in Mischief.ECS.Repeater

Associated Types

type IsExclusiveRel Repeater 
Instance details

Defined in Mischief.ECS.Repeater

Component VirtualTime Source # 
Instance details

Defined in Mischief.ECS.Time

Associated Types

type IsExclusiveRel VirtualTime 
Instance details

Defined in Mischief.ECS.Time

Typeable e => Component (Observer e) Source # 
Instance details

Defined in Mischief.ECS.Observer

Associated Types

type IsExclusiveRel (Observer e) 
Instance details

Defined in Mischief.ECS.Observer

(Typeable e, Typeable k) => Component (EventProxy e) Source # 
Instance details

Defined in Mischief.ECS.Observer

Associated Types

type IsExclusiveRel (EventProxy e) 
Instance details

Defined in Mischief.ECS.Observer

data From c Source #

Constructors

From 

Fields

Instances

Instances details
Functor From Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

fmap :: (a -> b) -> From a -> From b #

(<$) :: a -> From b -> From a #

(Component c, Queryable q out) => RelQuery 'False (MR c (Q q)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe [From out])) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe [From out])] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'False (MR c (Q' q QueryFilter)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'False (R c (Q q)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe [From out]) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, [From out])] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'False (R c (Q' q QueryFilter)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (MR c (Q q)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe (From out))) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe (From out))] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (MR c (Q' q QueryFilter)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (R c (Q q)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe (From out)) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, From out)] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (R c (Q' q QueryFilter)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Show c => Show (From c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

showsPrec :: Int -> From c -> ShowS #

show :: From c -> String #

showList :: [From c] -> ShowS #

Eq c => Eq (From c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

(==) :: From c -> From c -> Bool #

(/=) :: From c -> From c -> Bool #

Collectable c (BundleData ErasedComponent) => EraseIntoStorage (From c) (BundleData ErasedComponent) Source # 
Instance details

Defined in Mischief.ECS.Components

Collectable c (BundleData ErasedComponentEq) => EraseIntoStorage (From c) (BundleData ErasedComponentEq) Source # 
Instance details

Defined in Mischief.ECS.Components

type family IsExclusiveRel c :: Bool Source #

Set whether the relationships this component is used in are exclusive or not.

Instances

Instances details
type IsExclusiveRel FixedSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

type IsExclusiveRel ScheduleLabel Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

type IsExclusiveRel Schedules Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

type IsExclusiveRel StartupSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

type IsExclusiveRel UpdateSchedule Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

type IsExclusiveRel LastSystemTick Source # 
Instance details

Defined in Mischief.ECS.App.SystemDef

type IsExclusiveRel SystemTick Source # 
Instance details

Defined in Mischief.ECS.App.SystemDef

type IsExclusiveRel ScheduledIn Source # 
Instance details

Defined in Mischief.ECS.App.Systems

type IsExclusiveRel SystemFunction Source # 
Instance details

Defined in Mischief.ECS.App.Systems

type IsExclusiveRel Systems Source # 
Instance details

Defined in Mischief.ECS.App.Systems

type IsExclusiveRel ComponentArchetypes Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel ComponentPairs Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel ComponentType Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel DefaultValue Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel IsExclusiveRelationship Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel RequiredBy Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel Requires Source # 
Instance details

Defined in Mischief.ECS.Components

type IsExclusiveRel Name Source # 
Instance details

Defined in Mischief.ECS.Components.Common

type IsExclusiveRel ComponentAddHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel ComponentAddHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel ComponentRemoveHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel ComponentRemoveHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel ComponentSetHooks Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel ComponentSetHooksRel Source # 
Instance details

Defined in Mischief.ECS.Components.Spawn

type IsExclusiveRel FixedExtra Source # 
Instance details

Defined in Mischief.ECS.Fixed

type IsExclusiveRel FixedFrequency Source # 
Instance details

Defined in Mischief.ECS.Fixed

type IsExclusiveRel FixedTime Source # 
Instance details

Defined in Mischief.ECS.Fixed

type IsExclusiveRel ChildOf Source # 
Instance details

Defined in Mischief.ECS.Relationships.ChildOf

type IsExclusiveRel Before Source # 
Instance details

Defined in Mischief.ECS.Relationships.Order

type IsExclusiveRel Visited Source # 
Instance details

Defined in Mischief.ECS.Relationships.Order

type IsExclusiveRel Repeater Source # 
Instance details

Defined in Mischief.ECS.Repeater

type IsExclusiveRel VirtualTime Source # 
Instance details

Defined in Mischief.ECS.Time

type IsExclusiveRel (Observer e) Source # 
Instance details

Defined in Mischief.ECS.Observer

type IsExclusiveRel (EventProxy e) Source # 
Instance details

Defined in Mischief.ECS.Observer

data Rel c Source #

Type used for querying and inserting relationships.

Constructors

Rel 

Fields

Instances

Instances details
Functor Rel Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

fmap :: (a -> b) -> Rel a -> Rel b #

(<$) :: a -> Rel b -> Rel a #

Component c => RelQuery 'False (MR c Any) (Maybe [Rel c]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'False (R c Any) [Rel c] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (MR c Any) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (R c Any) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Show c => Show (Rel c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

showsPrec :: Int -> Rel c -> ShowS #

show :: Rel c -> String #

showList :: [Rel c] -> ShowS #

Eq c => Eq (Rel c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

(==) :: Rel c -> Rel c -> Bool #

(/=) :: Rel c -> Rel c -> Bool #

Component c => EraseIntoStorage (Rel c) (BundleData ErasedComponent) Source # 
Instance details

Defined in Mischief.ECS.Components

(Component c, Eq c) => EraseIntoStorage (Rel c) (BundleData ErasedComponentEq) Source # 
Instance details

Defined in Mischief.ECS.Components

Component c => Queryable (MR c Entity) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (R c Entity) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

newtype Res c Source #

Constructors

Res 

Fields

Instances

Instances details
Functor Res Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

fmap :: (a -> b) -> Res a -> Res b #

(<$) :: a -> Res b -> Res a #

Show c => Show (Res c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

showsPrec :: Int -> Res c -> ShowS #

show :: Res c -> String #

showList :: [Res c] -> ShowS #

Eq c => Eq (Res c) Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

(==) :: Res c -> Res c -> Bool #

(/=) :: Res c -> Res c -> Bool #

Component c => EraseIntoStorage (Res c) (BundleData ErasedComponent) Source # 
Instance details

Defined in Mischief.ECS.Components

(Component c, Eq c) => EraseIntoStorage (Res c) (BundleData ErasedComponentEq) Source # 
Instance details

Defined in Mischief.ECS.Components

Component c => Queryable (MRes c) (Maybe (Res c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (c -> Res c) (Res c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (c -> Res c) -> World -> Entity -> IO (Maybe (Res c)) Source #

runQueryInternal :: (c -> Res c) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Res c)] Source #

queryTypes :: (c -> Res c) -> Set (TypeRep, TypeQuery) Source #

newtype Tick Source #

Constructors

Tick Word64 

Instances

Instances details
Default Tick Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

def :: Tick #

Show Tick Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

showsPrec :: Int -> Tick -> ShowS #

show :: Tick -> String #

showList :: [Tick] -> ShowS #

Eq Tick Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

(==) :: Tick -> Tick -> Bool #

(/=) :: Tick -> Tick -> Bool #

Ord Tick Source # 
Instance details

Defined in Mischief.ECS.Components

Methods

compare :: Tick -> Tick -> Ordering #

(<) :: Tick -> Tick -> Bool #

(<=) :: Tick -> Tick -> Bool #

(>) :: Tick -> Tick -> Bool #

(>=) :: Tick -> Tick -> Bool #

max :: Tick -> Tick -> Tick #

min :: Tick -> Tick -> Tick #

require :: forall {k} (b :: k). RequiredBundle b => Set DefaultComponentType Source #

data Entity Source #

UNLIFTED

Points to an unique entity. The first Word# is an id, the second is a generation.

It is guaranteed that there can't be two alive entities with the same id.

Instances

Instances details
Show Entity Source # 
Instance details

Defined in Mischief.ECS.EntityDef

Eq Entity Source # 
Instance details

Defined in Mischief.ECS.EntityDef

Methods

(==) :: Entity -> Entity -> Bool #

(/=) :: Entity -> Entity -> Bool #

Ord Entity Source # 
Instance details

Defined in Mischief.ECS.EntityDef

Queryable E Entity Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

ListToOutgoing (Maybe Entity) Source # 
Instance details

Defined in Mischief.ECS.Relationships.Graph

ListToOutgoing [Entity] Source # 
Instance details

Defined in Mischief.ECS.Relationships.Graph

Component c => ToFilterComponent (R c Entity) Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

Component c => Queryable (HasR c Entity) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (MR c Entity) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (R c Entity) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

check :: forall m w. MonadSystem w m => QueryFilter -> Entity -> m Bool Source #

mkGet :: forall qd out (m :: Type -> Type). Queryable qd out => Entity -> qd -> Query m out Source #

mkGet' :: forall qd out (m :: Type -> Type). Queryable qd out => Entity -> qd -> QueryFilter -> Query m out Source #

mkQuery :: forall qd out (m :: Type -> Type). Queryable qd out => qd -> Query m out Source #

mkQuery' :: forall qd out (m :: Type -> Type). Queryable qd out => qd -> QueryFilter -> Query m out Source #

query :: MonadSystem w m => Query m out -> m [out] Source #

Run a Query, returning a list of values.

queryOne :: MonadSystem w m => Query m out -> m (Maybe out) Source #

Run a Query, returning an arbitrary element produced by it, or nothing if the query was null.

query_ :: MonadSystem w m => Query m out -> m () Source #

Run a Query.

runWhenOne :: Typeable a => Query System a -> (a -> System b) -> System () Source #

Same as runWhen, but runs when the provided query is not empty. Picks an arbitrary element to pass forward.

runWhenQ :: Typeable a => Query System a -> ([a] -> System b) -> System () Source #

Same as runWhen, but runs when the provided query is not empty.

single :: MonadSystem w m => Query m out -> m (Maybe out) Source #

Run a Query, returning an element only if it was the only result.

data Query (m :: Type -> Type) a Source #

A Query is a chain of operations which return a list of values when ran.

Instances

Instances details
MonadSystem w m => Applicative (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

pure :: a -> Query m a #

(<*>) :: Query m (a -> b) -> Query m a -> Query m b #

liftA2 :: (a -> b -> c) -> Query m a -> Query m b -> Query m c #

(*>) :: Query m a -> Query m b -> Query m b #

(<*) :: Query m a -> Query m b -> Query m a #

MonadSystem w m => Functor (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

fmap :: (a -> b) -> Query m a -> Query m b #

(<$) :: a -> Query m b -> Query m a #

MonadSystem w m => Monad (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

(>>=) :: Query m a -> (a -> Query m b) -> Query m b #

(>>) :: Query m a -> Query m b -> Query m b #

return :: a -> Query m a #

data QueryFilter where Source #

Constructors

NoFilter :: QueryFilter 
With :: forall a. ToFilterComponent a => a -> QueryFilter 
Without :: forall a. ToFilterComponent a => a -> QueryFilter 
Changed :: forall a. ToFilterComponent a => a -> (Tick -> Tick -> Bool) -> (Tick -> Tick -> Bool) -> QueryFilter 
And :: QueryFilter -> QueryFilter -> QueryFilter 
Or :: QueryFilter -> QueryFilter -> QueryFilter 

Instances

Instances details
Semigroup QueryFilter Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

(Component c, Queryable q out) => RelQuery 'False (MR c (Q' q QueryFilter)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'False (R c (Q' q QueryFilter)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (MR c (Q' q QueryFilter)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (R c (Q' q QueryFilter)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q' q QueryFilter)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

data Any Source #

Wildcard used when querying for relationships to indicate that you're querying for relationships with any target.

In the case of exclusive relationships, Any returns a single relationship rather than a list of relationships.

Constructors

Any 

Instances

Instances details
Component c => RelQuery 'False (MR c Any) (Maybe [Rel c]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'False (R c Any) [Rel c] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (MR c Any) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (R c Any) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => ToFilterComponent (R c Any) Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

Component c => Queryable (HasR c Any) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c Any) out => Queryable (MR c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (R c Any) out => Queryable (R c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

data C (a :: k) Source #

Used to query for a component or to remove a component. Forces queries to only include entities which have the component.

Example

Querying:

x <- query (C @Name)

Removing:

remove (C @Name)

Quasi Notation

None, you just write the component name directly. For instance:

x <- [q|Name|]

Constructors

C 

Instances

Instances details
Component c => ToFilterComponent (C c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

Component c => Queryable (C c) c Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

data E Source #

Used to query for the Entity.

Example

x <- query E

Quasi Notation

  • Entity
  • entity
  • E
  • e

For instance:

x <- [q|Entity|]

Constructors

E 

Instances

Instances details
Queryable E Entity Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

data Has (a :: k) Source #

Used in queries to return a Bool which indicates whether a component exists on the entity or not.

Example

x <- query (Has @Name)

Quasi Notation

  • Has
  • has
  • H
  • h

For instance:

x <- [q|Has Name|]

Constructors

Has 

Instances

Instances details
Component c => Queryable (Has c) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

newtype HasR (a :: k) b Source #

Exactly like R, except that it returns a Bool depending on whether the entity has such a relationship or not.

Example

x <- query (HasR @Likes Any)

Quasi Notation

  • Has
  • has
  • H
  • h

For instance:

x <- [q|Has Likes -> *|]

Constructors

HasR b 

Instances

Instances details
Component c => Queryable (HasR c Entity) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (HasR c Any) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q q)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q' q QueryFilter)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

data M (a :: k) Source #

Used to query for a component that an entity may or may not have.

Example

x <- query (M @Name)

Quasi Notation

  • Maybe
  • maybe
  • M
  • m

For instance:

x <- [q|Maybe Name|]

Constructors

M 

Instances

Instances details
Component c => Queryable (M c) (Maybe c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

newtype MR (a :: k) b Source #

Exactly like R, except that it wraps the result in a Maybe, also including entities that don't have such a relationship.

Example

x <- query (MR @Likes Any)

Quasi Notation

  • Maybe
  • maybe
  • M
  • m

For instance:

x <- [q|Maybe Likes -> *|]

Constructors

MR b 

Instances

Instances details
Component c => RelQuery 'False (MR c Any) (Maybe [Rel c]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'False (MR c (Q q)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe [From out])) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe [From out])] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'False (MR c (Q' q QueryFilter)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (MR c Any) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (MR c (Q q)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe (From out))) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe (From out))] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (MR c (Q' q QueryFilter)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c Any) out => Queryable (MR c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c (Q q)) out => Queryable (MR c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (MR c (Q' q f)) out => Queryable (MR c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

Component c => Queryable (MR c Entity) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

newtype Q a Source #

Used when writing transitive queries. See R.

Constructors

Q a 

Instances

Instances details
(Component c, Queryable q out) => RelQuery 'False (MR c (Q q)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe [From out])) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe [From out])] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'False (R c (Q q)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe [From out]) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, [From out])] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (MR c (Q q)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe (Maybe (From out))) Source #

relRunQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Maybe (From out))] Source #

relQueryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (R c (Q q)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe (From out)) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, From out)] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => Queryable (HasR c (Q q)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c (Q q)) out => Queryable (MR c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (R c (Q q)) out => Queryable (R c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

data Q' a b Source #

Used when writing transitive queries with filters. See R.

Constructors

Q' a b 

Instances

Instances details
(Component c, Queryable q out) => RelQuery 'False (MR c (Q' q QueryFilter)) (Maybe [From out]) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'False (R c (Q' q QueryFilter)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (MR c (Q' q QueryFilter)) (Maybe (From out)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (R c (Q' q QueryFilter)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q' q QueryFilter)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c (Q' q f)) out => Queryable (MR c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (R c (Q' q f)) out => Queryable (R c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

newtype R (a :: k) b Source #

Used to query for a relationships. Can be used in three different ways:

1. R c e

Queries for a relationship with a specific target. Forces queries to only include entities which have such a relationship.

Example

x <- query (R @Likes alice)
x :: [Result (Rel Likes)]

Quasi Notation

It is written with an arrow like so:

x <- [q|Likes -> alice|]

2. R c Any

Queries for all relationships with any target. Forces queries to only include entities which have at least one such relationship.

Example

x <- query (R @Likes Any)
x :: [[Result (Rel Likes)]]

Quasi Notation

x <- [q|Likes -> *|]

3. R c q

Runs a transitive query on the targets of all such relationships. q can either be Q d or Q' d f, depending if you want to also run a filter or not.

Similar to the previous case, it will limit the query to only entities which have such a relationship with at least one entity which matches the transitive query.

Example

x <- query (R @Likes (Q (C @Name))
x <- query (R @Likes (Q' (C @Name) (With (C @Enemy))))
x :: [[Result Name]]

Quasi Notation

You just write the given query in the () following the arrow. / can be used to give it a filter.

For instance:

x <- [q|Likes -> (Name)|]
x <- [q|Likes -> (Name / With Enemy)|]

Constructors

R b 

Instances

Instances details
Component c => RelQuery 'False (R c Any) [Rel c] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'False (R c (Q q)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe [From out]) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, [From out])] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'False (R c (Q' q QueryFilter)) [From out] Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => RelQuery 'True (R c Any) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => RelQuery 'True (R c (Q q)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

relRunQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe (From out)) Source #

relRunQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, From out)] Source #

relQueryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

(Component c, Queryable q out) => RelQuery 'True (R c (Q' q QueryFilter)) (From out) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => ToFilterComponent (R c Entity) Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

Component c => ToFilterComponent (R c Any) Source # 
Instance details

Defined in Mischief.ECS.World.Query.QueryFilter

RelQuery (IsExclusiveRel c) (R c Any) out => Queryable (R c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (R c (Q q)) out => Queryable (R c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (R c (Q' q f)) out => Queryable (R c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

Component c => Queryable (R c Entity) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

newtype R' (a :: k) b Source #

Constructors

R' b 

Instances

Instances details
RelQuery 'False (R c e) out => Queryable (R' c e) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R' c e -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R' c e -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R' c e -> Set (TypeRep, TypeQuery) Source #

insert :: HasCallStack => forall b. Bundle b => b -> Entity -> System () Source #

Insert a bundle of components on an Entity.

If the entity already contains these components, their values will be updated in-place instead of causing an archetype change.

insertNew :: Bundle b => b -> Entity -> System () Source #

Insert a bundle of components on an Entity.

Only the components that the entity doesn't already have will be inserted, and the rest ignored.

remove :: Collectable c ToRemove => c -> Entity -> System () Source #

despawn :: Entity -> System () Source #

Despawn an entity. This will trigger the OnRemove events and hooks on all its components.

spawn :: (HasCallStack, Bundle b) => b -> System Entity Source #

Spawn an entity given a bundle of components.

spawnDefer :: Bundle b => b -> ParSystem Entity Source #

Spawn an entity given a bundle of components, inside a ParSystem.

This will immediately reserve and return an Entity index which can be used, while defering the actual spawn.

spawn_ :: (HasCallStack, Bundle b) => b -> System () Source #

Same as spawn but discards the returned entity.

insertRes :: (Component r, Bundle r) => r -> System () Source #

Insert a resource into the World. If the resource already exists, its value will be overwritten.

res :: forall c m w. (MonadSystem w m, Component c) => m (Maybe c) Source #

Get the value of a resource from the World.

resOrInsert :: (Component r, Bundle r) => r -> System r Source #

Get the value of a resource, or insert a resource if it doesn't exist.

resOrInsertM :: (Component r, Bundle r) => System r -> System r Source #

Same as resOrInsert but allows the default resource to be produced by a System.

class Typeable e => Event e Source #

Event typeclass.

Instances

Instances details
(Typeable c, Typeable k) => Event (OnAdd c) Source # 
Instance details

Defined in Mischief.ECS.Events

(Typeable c, Typeable k) => Event (OnAddRel c) Source # 
Instance details

Defined in Mischief.ECS.Events

(Typeable c, Typeable k) => Event (OnRemove c) Source # 
Instance details

Defined in Mischief.ECS.Events

(Typeable c, Typeable k) => Event (OnRemoveRel c) Source # 
Instance details

Defined in Mischief.ECS.Events

(Typeable c, Typeable k) => Event (OnSet c) Source # 
Instance details

Defined in Mischief.ECS.Events

(Typeable c, Typeable k) => Event (OnSetRel c) Source # 
Instance details

Defined in Mischief.ECS.Events

runWhen :: Typeable a => System (Maybe a) -> (a -> System b) -> System () Source #

Primitive that allows you to set a system to run at every sync point until it returns a Just a, at which point it will run the second system with the obtained a and stop running.

It will run once on the spot, meaning it has no overhead if the first system immediately succeed.

You should only use this in one-time logic, such as Events or the Startup schedule. You should not use it in logic that runs continuously, such as in Update, as it will keep queueing up a new system to check without removing the old one.

class (GetWorld w, MonadReader w a, Applicative a, MonadFail a, Functor a, Monad a, MonadIO a, PrimMonad a, PrimState a ~ RealWorld, MonadThrow a, SystemAny a) => MonadSystem w (a :: Type -> Type) Source #

Typeclass that can be used to generalize systems to both System and ParSystem.

Used mainly by queries and other operations which don't mutate the World.

Instances

Instances details
MonadSystem ParWorld ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

data ParSystem a Source #

A variant of System that contains a ParWorld instead of World.

Parallel systems will only be able to run systems that are either specifically intended for them or are made to work with any MonadSystem (such as queries).

To run a normal System (), you need to defer!

Instances

Instances details
MonadThrow ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

throwM :: (HasCallStack, Exception e) => e -> ParSystem a #

Applicative ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

pure :: a -> ParSystem a #

(<*>) :: ParSystem (a -> b) -> ParSystem a -> ParSystem b #

liftA2 :: (a -> b -> c) -> ParSystem a -> ParSystem b -> ParSystem c #

(*>) :: ParSystem a -> ParSystem b -> ParSystem b #

(<*) :: ParSystem a -> ParSystem b -> ParSystem a #

Functor ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

fmap :: (a -> b) -> ParSystem a -> ParSystem b #

(<$) :: a -> ParSystem b -> ParSystem a #

Monad ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

(>>=) :: ParSystem a -> (a -> ParSystem b) -> ParSystem b #

(>>) :: ParSystem a -> ParSystem b -> ParSystem b #

return :: a -> ParSystem a #

MonadFail ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

fail :: String -> ParSystem a #

MonadIO ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

liftIO :: IO a -> ParSystem a #

SystemAny ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Methods

systemAny :: System a -> ParSystem a -> ParSystem a Source #

PrimMonad ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

Associated Types

type PrimState ParSystem 
Instance details

Defined in Mischief.ECS.World

MonadSystem ParWorld ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

MonadReader ParWorld ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

type PrimState ParSystem Source # 
Instance details

Defined in Mischief.ECS.World

data System a Source #

A System is a monad that mutates the World.

It can be added to a certain schedule and ordered with other systems. It also offers IO access via liftIO.

Read the tutorial on systems for more details.

Instances

Instances details
MonadThrow System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

throwM :: (HasCallStack, Exception e) => e -> System a #

Applicative System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

pure :: a -> System a #

(<*>) :: System (a -> b) -> System a -> System b #

liftA2 :: (a -> b -> c) -> System a -> System b -> System c #

(*>) :: System a -> System b -> System b #

(<*) :: System a -> System b -> System a #

Functor System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

fmap :: (a -> b) -> System a -> System b #

(<$) :: a -> System b -> System a #

Monad System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

(>>=) :: System a -> (a -> System b) -> System b #

(>>) :: System a -> System b -> System b #

return :: a -> System a #

MonadFail System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

fail :: String -> System a #

MonadIO System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

liftIO :: IO a -> System a #

SystemAny System Source # 
Instance details

Defined in Mischief.ECS.World

Methods

systemAny :: System a -> ParSystem a -> System a Source #

PrimMonad System Source # 
Instance details

Defined in Mischief.ECS.World

Associated Types

type PrimState System 
Instance details

Defined in Mischief.ECS.World

Methods

primitive :: (State# (PrimState System) -> (# State# (PrimState System), a #)) -> System a #

EraseIntoStorage (System ()) Systems Source # 
Instance details

Defined in Mischief.ECS.Systems

Methods

erase :: System () -> Systems Source #

EraseIntoStorage (System ()) [System ()] Source # 
Instance details

Defined in Mischief.ECS.World

Methods

erase :: System () -> [System ()] Source #

type PrimState System Source # 
Instance details

Defined in Mischief.ECS.World

data TimePlugin Source #

Plugin that keeps track of time. Enables calling delta, elapsed, and so on.

Note that these methods are context-dependent. For instance, if used in a Fixed schedule, delta will always return the time as inferred from the fixed frequency.

Instances

Instances details
Plugin TimePlugin Source # 
Instance details

Defined in Mischief.ECS.Time

defer :: MonadSystem w m => System a -> m () Source #

Defer a System. This will put it in the current deferred queue which is typically flushed in-between scheduled systems.

This is useful for executing mutations in parallel systems.

You can manually flush the queue with flush.

delay :: MonadSystem w m => Float -> System a -> m () Source #

Delay a system by a given amount of seconds.

Example:

delay 1.5 $ insert (Health 100) player

flush :: System () Source #

Flush the current list of deferred commands.

runAfter :: MonadSystem w m => IO a -> (a -> System ()) -> m () Source #

Run an IO action asynchronously before running a System with its output. Useful when performing significant IO such as reading / loading files.

addPlugin :: Plugin p => App -> IO () Source #

Add a plugin to the App.

newApp :: IO App Source #

Create a new App.

runApp :: App -> IO () Source #

Run the App.

data App Source #

The App is a wrapper around the World through which plugins can be added.

class Typeable p => Plugin p where Source #

Minimal complete definition

Nothing

Instances

Instances details
Plugin FixedPlugin Source # 
Instance details

Defined in Mischief.ECS.Fixed

Plugin TimePlugin Source # 
Instance details

Defined in Mischief.ECS.Time

scheduleEntity :: forall {k} (sch :: k). Schedule sch => System Entity Source #

data PostStartup Source #

Instances

Instances details
Schedule PostStartup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

data PostUpdate Source #

Instances

Instances details
Schedule PostUpdate Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

data PreStartup Source #

Instances

Instances details
Schedule PreStartup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

data PreUpdate Source #

Instances

Instances details
Schedule PreUpdate Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

class Typeable s => Schedule (s :: k) Source #

Instances

Instances details
Schedule First Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Init Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Last Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule PostStartup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule PostUpdate Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule PreStartup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule PreUpdate Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Startup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Update Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Fixed Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedFirst Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedLast Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedPostUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedPreUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

data Startup Source #

Instances

Instances details
Show Startup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Startup Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

data Update Source #

Instances

Instances details
Show Update Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

Schedule Update Source # 
Instance details

Defined in Mischief.ECS.App.Schedules

order :: forall {k} (sc :: k) a b. (Schedule sc, ToSystems a, ToSystems b) => (a, b) -> System () Source #

schedule :: forall {k} (sc :: k). Schedule sc => SystemConfig -> System () Source #

unschedule :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System () Source #

Disconnect a system from a schedule. This will keep the system's entity alive, as well as all its other relationships and data, so that if scheduled again it will work the same as before. Use this if you plan to dynamically schedule and unschedule a system. Otherwise check unschedule'.

unschedule' :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System () Source #

Disconnect a system rom a schedule. This will despawn the system's entity, losing all its data such as ordering with other systems. Use this if you want to disable a scheduled system for good. Otherwise check unschedule.

expect :: (HasCallStack, Unwrappable f) => Text -> f a -> a Source #

Unwrap a Maybe or Either, throwing the given error if it doesn't contain a value.

mapLeft :: (a -> c) -> Either a b -> Either c b Source #

unwrap :: (HasCallStack, Unwrappable f) => f a -> a Source #

Unwrap a Maybe or Either, panicking if it doesn't contain a value.

data Hook (a :: k) Source #

newtype HookContext Source #

Constructors

HookContext 

Fields

data HookRel (a :: k) Source #

data Timer Source #

A type that can be used to keep track of time.

newtype Observer e Source #

Constructors

Observer (e -> System ()) 

Instances

Instances details
Typeable e => Component (Observer e) Source # 
Instance details

Defined in Mischief.ECS.Observer

Associated Types

type IsExclusiveRel (Observer e) 
Instance details

Defined in Mischief.ECS.Observer

type IsExclusiveRel (Observer e) Source # 
Instance details

Defined in Mischief.ECS.Observer

newtype FixedFrequency Source #

Resource determining the frequency at which Fixed schedules are ran. Defaults to 0.03 (30fps).

Constructors

FixedFrequency Float 

data FixedPlugin Source #

Plugin that enables running systems in Fixed schedules such as FixedUpdate and FixedPostUpdate.

Overwrite the FixedFrequency resource to change the frequency at which Fixed schedules are ran.

Instances

Instances details
Plugin FixedPlugin Source # 
Instance details

Defined in Mischief.ECS.Fixed

data FixedPostUpdate Source #

Instances

Instances details
Show FixedPostUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedPostUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

data FixedPreUpdate Source #

Instances

Instances details
Show FixedPreUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedPreUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

data FixedUpdate Source #

Instances

Instances details
Show FixedUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

Schedule FixedUpdate Source # 
Instance details

Defined in Mischief.ECS.Fixed

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

This is a version of flip id, where id is specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->) is (a -> b) -> a -> b. flipping this yields a -> (a -> b) -> b which is the type signature of &

Examples

Expand
>>> 5 & (+1) & show
"6"
>>> sqrt $ [1 / n^2 | n <- [1..1000]] & sum & (*6)
3.1406380562059946

Since: base-4.8.0.0

class Queryable qd output | qd -> output Source #

Minimal complete definition

runQueryEntity, runQueryInternal, queryTypes

Instances

Instances details
Queryable E Entity Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Queryable () () Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (C c) c Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (Has c) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (HasRes c) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (M c) (Maybe c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (MRes c) (Maybe (Res c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (c -> Res c) (Res c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (c -> Res c) -> World -> Entity -> IO (Maybe (Res c)) Source #

runQueryInternal :: (c -> Res c) -> [ArchetypeId] -> World -> IO [(Entity, Bool, Res c)] Source #

queryTypes :: (c -> Res c) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1) => Queryable (q0, q1) (o0, o1) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1) -> World -> Entity -> IO (Maybe (o0, o1)) Source #

runQueryInternal :: (q0, q1) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1))] Source #

queryTypes :: (q0, q1) -> Set (TypeRep, TypeQuery) Source #

Component c => Queryable (HasR c Entity) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (HasR c Any) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q q)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Component c, Queryable q out) => Queryable (HasR c (Q' q QueryFilter)) Bool Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c Any) out => Queryable (MR c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (MR c (Q q)) out => Queryable (MR c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q q) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (MR c (Q' q f)) out => Queryable (MR c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: MR c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: MR c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: MR c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (R c Any) out => Queryable (R c Any) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

RelQuery (IsExclusiveRel c) (R c (Q q)) out => Queryable (R c (Q q)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q q) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q q) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q q) -> Set (TypeRep, TypeQuery) Source #

RelQuery (IsExclusiveRel c) (R c (Q' q f)) out => Queryable (R c (Q' q f)) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R c (Q' q f) -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R c (Q' q f) -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R c (Q' q f) -> Set (TypeRep, TypeQuery) Source #

RelQuery 'False (R c e) out => Queryable (R' c e) out Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: R' c e -> World -> Entity -> IO (Maybe out) Source #

runQueryInternal :: R' c e -> [ArchetypeId] -> World -> IO [(Entity, Bool, out)] Source #

queryTypes :: R' c e -> Set (TypeRep, TypeQuery) Source #

Component c => Queryable (MR c Entity) (Maybe (Rel c)) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Component c => Queryable (R c Entity) (Rel c) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2) => Queryable (q0, q1, q2) (o0, o1, o2) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2) -> World -> Entity -> IO (Maybe (o0, o1, o2)) Source #

runQueryInternal :: (q0, q1, q2) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2))] Source #

queryTypes :: (q0, q1, q2) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3) => Queryable (q0, q1, q2, q3) (o0, o1, o2, o3) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3)) Source #

runQueryInternal :: (q0, q1, q2, q3) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3))] Source #

queryTypes :: (q0, q1, q2, q3) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4) => Queryable (q0, q1, q2, q3, q4) (o0, o1, o2, o3, o4) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4))] Source #

queryTypes :: (q0, q1, q2, q3, q4) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5) => Queryable (q0, q1, q2, q3, q4, q5) (o0, o1, o2, o3, o4, o5) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6) => Queryable (q0, q1, q2, q3, q4, q5, q6) (o0, o1, o2, o3, o4, o5, o6) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7) (o0, o1, o2, o3, o4, o5, o6, o7) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8) (o0, o1, o2, o3, o4, o5, o6, o7, o8) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9, Queryable q10 o10) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9, Queryable q10 o10, Queryable q11 o11) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9, Queryable q10 o10, Queryable q11 o11, Queryable q12 o12) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9, Queryable q10 o10, Queryable q11 o11, Queryable q12 o12, Queryable q13 o13) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13) -> Set (TypeRep, TypeQuery) Source #

(Queryable q0 o0, Queryable q1 o1, Queryable q2 o2, Queryable q3 o3, Queryable q4 o4, Queryable q5 o5, Queryable q6 o6, Queryable q7 o7, Queryable q8 o8, Queryable q9 o9, Queryable q10 o10, Queryable q11 o11, Queryable q12 o12, Queryable q13 o13, Queryable q14 o14) => Queryable (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14) (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14) Source # 
Instance details

Defined in Mischief.ECS.World.Query.Queryable

Methods

runQueryEntity :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14) -> World -> Entity -> IO (Maybe (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14)) Source #

runQueryInternal :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14) -> [ArchetypeId] -> World -> IO [(Entity, Bool, (o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14))] Source #

queryTypes :: (q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14) -> Set (TypeRep, TypeQuery) Source #

meta :: Component c => System Entity Source #

Return the meta entity corresponding to a given component.