Exemplo n.º 1
0
        public override void Enter(StateContext <Game> context)
        {
            MessageBroker.Default.Receive <GameMsgEnd>()
            .Subscribe(end => context.GoToState(new GameOver()))
            .AddTo(this);

            MessageBroker.Default.Receive <GameMsgPause>()
            .Subscribe(pause => context.GoToState(new Paused()))
            .AddTo(this);
        }
Exemplo n.º 2
0
        public override void Enter(StateContext <Game> context)
        {
            MessageBroker.Default.Receive <GameMsgRestart>()
            .Subscribe(restart => context.GoToState(new StartScreen()))
            .AddTo(this);

            MessageBroker.Default.Receive <GameMsgStart>()
            .Subscribe(restart => context.GoToState(new Running()))
            .AddTo(this);
        }
Exemplo n.º 3
0
 public override void Enter(StateContext <Game> context)
 {
     MessageBroker.Default.Receive <GameMsgFinishedLoading>()
     .Subscribe(loading => context.GoToState(new StartScreen()))
     .AddTo(this);
 }
Exemplo n.º 4
0
 public override void Enter(StateContext <Game> context)
 {
     MessageBroker.Default.Receive <GameMsgUnpause>()
     .Subscribe(unpause => context.GoToState(new Running()))
     .AddTo(this);
 }
Exemplo n.º 5
0
 public override void Enter(StateContext <FunnyMovementComponent> context)
 {
     Observable.Timer(TimeSpan.FromSeconds(3))
     .Subscribe(l => context.GoToState(new Standing()))
     .AddTo(this);
 }
Exemplo n.º 6
0
 public void Grow()
 {
     Context.GoToState(new BlowFishState.Growing(this));
 }