gore-and-ash-actor-1.1.0.0: Gore&Ash engine extension that implements actor style of programming

Copyright(c) Anton Gushcha, 2015-2016
LicenseBSD3
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Game.GoreAndAsh.Actor.State

Description

Internal state of actor core module.

Synopsis

Documentation

data ActorState s Source

Inner state of actor module.

s
- State of next module, the states are chained via nesting.

Constructors

ActorState 

Fields

actorBoxes :: !(HashMap (HashableTypeRep, Int) (Seq Dynamic, Seq Dynamic))

Stores messages for actor with specified id

Message has type of Dynamic as message manager doesn't know anything about message types. We don't need to serialization protocol due passing via memory. Type safety is forced with Messagable type class with type family (see Actor.Message module). Id space is separate for each actor type

There are two sequences of messages, one for recieved messages from previous frame, and the second one for messages recieved at current frame. At the end of each frame first sequence is purged and filled with contents of first and the second one is replaced with empty sequence.

actorNextId :: !(HashMap HashableTypeRep Int)

Next empty id of actor, id space is separate for each actor type

actorNameMap :: !(HashMap String HashableTypeRep)

Search table for actor names

actorNextState :: !s

Next state in state chain of modules

emptyActorState :: s -> ActorState s Source

Create empty actor state

moveSendedMessages :: ActorState s -> ActorState s Source

Perform rotation between sended messages and recieved ones