示例#1
0
            public override EventResult HandleEvent(EventContext context, MessageClosedEvent @event)
            {
                ActorInstance actorInstance = context.GetActorInstanceById(BoardExitsActorInstanceId);

                context.EnqueueCommand(Commands.ActorInstanceDestroy(actorInstance));

                return(EventResult.Completed);
            }
            public override EventResult HandleEvent(EventContext context, TimerElapsedEvent @event)
            {
                ActorInstance           timerActorInstance      = context.GetActorInstanceById(TimerActorInstanceId);
                SetTileCharacterCommand setTileCharacterCommand = Commands.SetTileCharacter(
                    timerActorInstance,
                    new Character(_symbols[_symbolIndex], timerActorInstance.Character.ForegroundColor, timerActorInstance.Character.BackgroundColor));

                context.EnqueueCommand(setTileCharacterCommand);

                if (++_symbolIndex == _symbols.Length)
                {
                    _symbolIndex = 0;
                }

                return(EventResult.Completed);
            }