Example #1
0
 private void StopPlayingCurrentMovie()
 {
     Colorconsole.WriteLineYellow($"user has stoped watching {_currentlyWatching}");
     _currentlyWatching = null;
     Become(Stopped);
     Colorconsole.WriteLineYellow("UserActore has become Stopped");
 }
Example #2
0
 private void StartPlayingMovie(string movieTitle)
 {
     _currentlyWatching = movieTitle;
     Colorconsole.WriteLineYellow($"UserActor {_userId } is currently watching {_currentlyWatching}");
     Context.ActorSelection("/user/Playback/PlaybackStatistics/MoviePlayCounter").Tell(new IncrementPlayCountMessage(movieTitle));
     Become(Playing);
     Colorconsole.WriteLineCyan("UserActor has now become Playing");
 }
Example #3
0
        private void Stopped()
        {
            Receive <PlayMovieMessage>(message => StartPlayingMovie(message.MovieTitle));
            Receive <StopMovieMessage>(
                message => Colorconsole.WriteLineRed("Error: cannot stop if nothing is playing"));

            Colorconsole.WriteLineYellow("UserActor has now become Stopped");
        }
Example #4
0
 protected override void PostRestart(Exception reason)
 {
     Colorconsole.WriteLineYellow($"UserActor PreReStart because: {reason}");
     base.PostRestart(reason);
 }
Example #5
0
        protected override void PreRestart(Exception reason, object message)
        {
            Colorconsole.WriteLineYellow($"UserActor PreRestart because: {reason}");

            base.PreRestart(reason, message);
        }
Example #6
0
 protected override void PostStop()
 {
     Colorconsole.WriteLineYellow("UserActor PostStop");
 }
Example #7
0
 protected override void PreStart()
 {
     Colorconsole.WriteLineYellow("UserActor PreStart");
 }