gore-and-ash-sync-1.1.1.0: Gore&Ash module for high level network synchronization

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

Game.GoreAndAsh.Sync.Remote.Collection

Description

 

Synopsis

Documentation

remoteActorCollectionServer Source

Arguments

:: (MonadFix m, SyncMonad m, LoggingMonad m, ActorMonad m, NetworkMonad m, Eq i, RemoteActor i b, DynCollection c, FilterConstraint c (GameWireIndexed m i a b), FilterConstraint c (Either () (b, i)), Foldable c2, Functor c2) 
=> c (GameActor m i a b)

Initial set of actors

-> GameActor m RemActorCollId (a, Event (c (GameActor m i a b)), Event (c2 i)) (c b) 

Server side collection of network actors that are automatically synchronized to remote clients (creation and removing of actors).

  • Second wire input is event with new actors to add to the collection
  • Third wire input is event with id of actor to delete from the collection

Note: the collection doesn't do synchronization of actor internal state, you should call clientSync by yourself.

remoteActorCollectionClient Source

Arguments

:: (SyncMonad m, LoggingMonad m, ActorMonad m, NetworkMonad m, Eq i, RemoteActor i b) 
=> RemActorCollId

Corresponding server collection id

-> Peer

Server peer

-> (i -> GameActor m i a b)

How to construct client side actors

-> GameActor m RemActorCollId a (Seq b) 

Client side collection of network actors that are automatically synchronized to remote clients (creation and removing of actors).

Note: the collection doesn't do synchronization of actor internal state, you should call serverSync by yourself.