ohhecs-0.0.2: An Entity-Component-Systems engine core.
Copyright(C) 2020 Sophie Taylor
LicenseAGPL-3.0-or-later
MaintainerSophie Taylor <sophie@spacekitteh.moe>
Stabilityexperimental
PortabilityGHC
Safe HaskellTrustworthy
LanguageGHC2021

Games.ECS.Prototype.SpawnedFromPrototype

Description

A component to mark an entity as being spawned from a prototype.

Synopsis

Documentation

data SpawnedFromPrototype Source #

Marks an entity as being spawned from a prototype.

Constructors

SpawnedFromPrototype 

Fields

Instances

Instances details
Generic SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

Associated Types

type Rep SpawnedFromPrototype 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type Rep SpawnedFromPrototype = D1 ('MetaData "SpawnedFromPrototype" "Games.ECS.Prototype.SpawnedFromPrototype" "ohhecs-0.0.2-inplace" 'False) (C1 ('MetaCons "SpawnedFromPrototype" 'PrefixI 'True) (S1 ('MetaSel ('Just "_prototypeEntity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Entity) :*: S1 ('MetaSel ('Just "_spawnedFromPrototypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe PrototypeID))))
Show SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

Eq SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

Component SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

XMLPickler [Node] SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type Rep SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type Rep SpawnedFromPrototype = D1 ('MetaData "SpawnedFromPrototype" "Games.ECS.Prototype.SpawnedFromPrototype" "ohhecs-0.0.2-inplace" 'False) (C1 ('MetaCons "SpawnedFromPrototype" 'PrefixI 'True) (S1 ('MetaSel ('Just "_prototypeEntity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Entity) :*: S1 ('MetaSel ('Just "_spawnedFromPrototypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe PrototypeID))))
type CanonicalName SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type CanonicalName SpawnedFromPrototype = "spawnedFromPrototype"
type IsFlag SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type Prop SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

type Storage SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype.SpawnedFromPrototype

spawnPrototype :: (UsingSpawnedFromPrototype w 'Individual, UsingIsPrototype w 'Individual, MonadIO m) => Entity -> w 'Storing -> m (Maybe (w 'Individual, w 'Storing)) Source #

Spawn a new individual with the given prototype Entity reference. Returns the new individual, and the new world.

spawnNamedPrototype :: (UsingSpawnedFromPrototype w 'Individual, UsingIsPrototype w 'Individual, MonadIO m) => PrototypeID -> w 'Storing -> m (Maybe (w 'Individual, w 'Storing)) Source #

Spawns a new individual with a given PrototypeID, which is looked up in the associated map. Returns the new individual, and the new world.

prototypes :: forall (w :: Access -> Type). HasIsPrototype w => IndexedTraversal' Entity (w 'Storing) (w 'Individual) Source #

All the prototypical individuals in a world.