Copyright | (C) 2020 Sophie Taylor |
---|---|
License | AGPL-3.0-or-later |
Maintainer | Sophie Taylor <sophie@spacekitteh.moe> |
Stability | experimental |
Portability | GHC |
Safe Haskell | Trustworthy |
Language | GHC2021 |
Games.ECS.Prototype.SpawnedFromPrototype
Description
A component to mark an entity as being spawned from a prototype.
Synopsis
- data SpawnedFromPrototype = SpawnedFromPrototype {}
- prototypeEntity :: Lens' SpawnedFromPrototype Entity
- spawnedFromPrototypeID :: Lens' SpawnedFromPrototype (Maybe PrototypeID)
- type UsingSpawnedFromPrototype (worldType :: Access -> Type) (s :: Access) = (HasSpawnedFromPrototype worldType, EntityProperty "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType s) SpawnedFromPrototype)
- class (World worldType, Component SpawnedFromPrototype, EntityProperty "spawnedFromPrototype" worldType 'Individual (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType 'Storing (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType 'Storing) SpawnedFromPrototype) => HasSpawnedFromPrototype (worldType :: Access -> Type) where
- spawnedFromPrototype :: forall {s :: Access}. (EntityProperty "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType s) SpawnedFromPrototype) => IndexedTraversal' Entity (worldType s) SpawnedFromPrototype
- addSpawnedFromPrototype :: IndexedSetter' Entity (worldType 'Individual) SpawnedFromPrototype
- removeSpawnedFromPrototype :: worldType 'Individual -> worldType 'Individual
- withSpawnedFromPrototype :: Fold (worldType 'Storing) IntersectionOfEntities
- spawnPrototype :: (UsingSpawnedFromPrototype w 'Individual, UsingIsPrototype w 'Individual, MonadIO m) => Entity -> w 'Storing -> m (Maybe (w 'Individual, w 'Storing))
- spawnNamedPrototype :: (UsingSpawnedFromPrototype w 'Individual, UsingIsPrototype w 'Individual, MonadIO m) => PrototypeID -> w 'Storing -> m (Maybe (w 'Individual, w 'Storing))
- prototypes :: forall (w :: Access -> Type). HasIsPrototype w => IndexedTraversal' Entity (w 'Storing) (w 'Individual)
Documentation
data SpawnedFromPrototype Source #
Marks an entity as being spawned from a prototype.
Constructors
SpawnedFromPrototype | |
Fields
|
Instances
type UsingSpawnedFromPrototype (worldType :: Access -> Type) (s :: Access) = (HasSpawnedFromPrototype worldType, EntityProperty "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType s) SpawnedFromPrototype) Source #
class (World worldType, Component SpawnedFromPrototype, EntityProperty "spawnedFromPrototype" worldType 'Individual (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType 'Storing (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType 'Storing) SpawnedFromPrototype) => HasSpawnedFromPrototype (worldType :: Access -> Type) where Source #
Methods
spawnedFromPrototype :: forall {s :: Access}. (EntityProperty "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype, OpticsFor "spawnedFromPrototype" worldType s (Prop SpawnedFromPrototype) SpawnedFromPrototype ~ ReifiedIndexedTraversal' Entity (worldType s) SpawnedFromPrototype) => IndexedTraversal' Entity (worldType s) SpawnedFromPrototype Source #
addSpawnedFromPrototype :: IndexedSetter' Entity (worldType 'Individual) SpawnedFromPrototype Source #
removeSpawnedFromPrototype :: worldType 'Individual -> worldType 'Individual Source #
withSpawnedFromPrototype :: Fold (worldType 'Storing) IntersectionOfEntities Source #
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.