| Copyright | (c) Anton Gushcha, 2015-2016 |
|---|---|
| License | BSD3 |
| Maintainer | ncrashed@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Game.GoreAndAsh.Sync.Remote.Collection
Description
- newtype RemActorCollId = RemActorCollId {}
- remoteActorCollectionServer :: forall m a b c c2 i. (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) -> GameActor m RemActorCollId (a, Event (c (GameActor m i a b)), Event (c2 i)) (c b)
- remoteActorCollectionClient :: forall m i a b. (SyncMonad m, LoggingMonad m, ActorMonad m, NetworkMonad m, Eq i, RemoteActor i b) => RemActorCollId -> Peer -> (i -> GameActor m i a b) -> GameActor m RemActorCollId a (Seq b)
Documentation
newtype RemActorCollId Source #
Unique id space for remote collections actors
Constructors
| RemActorCollId | |
Fields | |
Instances
| Eq RemActorCollId Source # | |
| Ord RemActorCollId Source # | |
| Show RemActorCollId Source # | |
| Generic RemActorCollId Source # | |
| NFData RemActorCollId Source # | |
| Hashable RemActorCollId Source # | |
| ActorMessage RemActorCollId Source # | |
| NetworkMessage RemActorCollId Source # | |
| type Rep RemActorCollId Source # | |
| type ActorMessageType RemActorCollId Source # | |
| 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.