gore-and-ash-sync-1.2.0.1: 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

newtype RemActorCollId Source #

Unique id space for remote collections actors

Constructors

RemActorCollId 

Instances

Eq RemActorCollId Source # 
Ord RemActorCollId Source # 
Show RemActorCollId Source # 
Generic RemActorCollId Source # 

Associated Types

type Rep RemActorCollId :: * -> * #

NFData RemActorCollId Source # 

Methods

rnf :: RemActorCollId -> () #

Hashable RemActorCollId Source # 
ActorMessage RemActorCollId Source # 

Associated Types

type ActorMessageType RemActorCollId :: *

NetworkMessage RemActorCollId Source # 

Associated Types

type NetworkMessageType RemActorCollId :: * Source #

type Rep RemActorCollId Source # 
type Rep RemActorCollId = D1 (MetaData "RemActorCollId" "Game.GoreAndAsh.Sync.Remote.Collection" "gore-and-ash-sync-1.2.0.1-C0M5s2yQvsxJQyH5pbk8Jg" True) (C1 (MetaCons "RemActorCollId" PrefixI True) (S1 (MetaSel (Just Symbol "unRemActorCollId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))
type ActorMessageType RemActorCollId Source # 
type ActorMessageType RemActorCollId
type NetworkMessageType RemActorCollId Source # 

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.