ohhecs-0.0.1: 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

Description

Prototypes are exemplar individuals which form a template.

Synopsis

Documentation

newtype PrototypeID Source #

A prototype's ID is distinct from its entity reference in that it is stable, and in a unique namespace.

Constructors

PrototypeID 

Fields

Instances

Instances details
Bounded PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Enum PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Generic PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Associated Types

type Rep PrototypeID 
Instance details

Defined in Games.ECS.Prototype

type Rep PrototypeID = D1 ('MetaData "PrototypeID" "Games.ECS.Prototype" "ohhecs-0.0.1-inplace" 'True) (C1 ('MetaCons "PrototypeID" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unPrototypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
Ix PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Show PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Eq PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Ord PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Hashable PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

HasPrototypeID PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

XMLPickleAsAttribute PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Unbox PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

Vector Vector PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

MVector MVector PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

type Rep PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

type Rep PrototypeID = D1 ('MetaData "PrototypeID" "Games.ECS.Prototype" "ohhecs-0.0.1-inplace" 'True) (C1 ('MetaCons "PrototypeID" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unPrototypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
newtype Vector PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

newtype MVector s PrototypeID Source # 
Instance details

Defined in Games.ECS.Prototype

data IsPrototype Source #

A component for denoting that an individual is a prototype, to be instantiated later.

Constructors

IsPrototype 

Fields

Instances

Instances details
Generic IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

Associated Types

type Rep IsPrototype 
Instance details

Defined in Games.ECS.Prototype

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

Defined in Games.ECS.Prototype

Eq IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

Component IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

Associated Types

type CanonicalName IsPrototype 
Instance details

Defined in Games.ECS.Prototype

type CanonicalName IsPrototype = "isPrototype"
type IsFlag IsPrototype 
Instance details

Defined in Games.ECS.Prototype

type Storage IsPrototype 
Instance details

Defined in Games.ECS.Prototype

type Prop IsPrototype 
Instance details

Defined in Games.ECS.Prototype

HasPrototypeID IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

XMLPickler [Node] IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Rep IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

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

Defined in Games.ECS.Prototype

type CanonicalName IsPrototype = "isPrototype"
type IsFlag IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Prop IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Storage IsPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

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

Associated Types

type Rep SpawnedFromPrototype 
Instance details

Defined in Games.ECS.Prototype

type Rep SpawnedFromPrototype = D1 ('MetaData "SpawnedFromPrototype" "Games.ECS.Prototype" "ohhecs-0.0.1-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

Eq SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

Component SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

Associated Types

type CanonicalName SpawnedFromPrototype 
Instance details

Defined in Games.ECS.Prototype

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

Defined in Games.ECS.Prototype

type Storage SpawnedFromPrototype 
Instance details

Defined in Games.ECS.Prototype

type Prop SpawnedFromPrototype 
Instance details

Defined in Games.ECS.Prototype

XMLPickler [Node] SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Rep SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Rep SpawnedFromPrototype = D1 ('MetaData "SpawnedFromPrototype" "Games.ECS.Prototype" "ohhecs-0.0.1-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

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

Defined in Games.ECS.Prototype

type Prop SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type Storage SpawnedFromPrototype Source # 
Instance details

Defined in Games.ECS.Prototype

type UsingIsPrototype (worldType :: Access -> Type) (s :: Access) = (HasIsPrototype worldType, EntityProperty "isPrototype" worldType s (Prop IsPrototype) IsPrototype, OpticsFor "isPrototype" worldType s (Prop IsPrototype) IsPrototype ~ ReifiedIndexedTraversal' Entity (worldType s) IsPrototype) 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.

type PrototypeNameMap = HashMap PrototypeID Entity Source #

A dictionary between a PrototypeID and the characterising Entity.

spawnNamedPrototype :: (UsingSpawnedFromPrototype w 'Individual, UsingIsPrototype w 'Individual, MonadIO m) => PrototypeNameMap -> 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.