gore-and-ash-actor-1.2.2.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.Indexed

Description

 

Synopsis

Documentation

data GameWireIndexed m i a b Source #

Game wire that has its own id

Constructors

GameWireIndexed 

Fields

Instances

Eq i => Eq (GameWireIndexed m i a b) Source #

Equality by equality of ids

Methods

(==) :: GameWireIndexed m i a b -> GameWireIndexed m i a b -> Bool #

(/=) :: GameWireIndexed m i a b -> GameWireIndexed m i a b -> Bool #

type GameActor m i a b = GameMonadT m (GameWireIndexed m i a b) Source #

Common pattern in game for creating incapsulated objects

Usually wires that are actors need context to register themselfes in core. Major part of wire functions operates with such wrapped indexed arrows thats why the convinient type synonym is exists.

updateIndexedWire :: (GameWire m a b -> GameWire m a b) -> GameWireIndexed m i a b -> GameWireIndexed m i a b Source #

Replaces controlling wire in indexed wire

postActorAction :: Monad m => GameActor m i a b -> (i -> GameWire m b c) -> GameActor m i a c Source #

Compose actor and wire, the wire is added at the end of actor controller

preActorAction :: Monad m => (i -> GameWire m c a) -> GameActor m i a b -> GameActor m i c b Source #

Compose actor and wire, the wire is added at the beginning of actor controller