protected override EventResult OnElapsed(EventContext context, TimerElapsedEvent @event)
        {
            IEnumerable<ActorInstance> actorInstances = context.CurrentBoard.ActorInstanceLayer.ActorInstances.Where(arg => arg.ActorId == BoardsActor.ActorId);

            foreach (ActorInstanceRandomMoveCommand command in actorInstances.Select(arg => Commands.ActorInstanceRandomMove(arg)))
            {
                context.EnqueueCommand(command);
            }

            return EventResult.Completed;
        }
Пример #2
0
        protected internal virtual EventResult OnTouchedByActorInstance(EventContext context, ActorInstanceTouchedPlayerEvent @event)
        {
            context.ThrowIfNull("context");
            @event.ThrowIfNull("event");

            return _eventHandlerCollection.SafeInvoke(context, @event);
        }
Пример #3
0
        protected internal virtual EventResult OnMoved(EventContext context, ActorInstanceMovedEvent @event)
        {
            context.ThrowIfNull("context");
            @event.ThrowIfNull("event");

            return _eventHandlerCollection.SafeInvoke(context, @event);
        }
Пример #4
0
        protected internal virtual EventResult OnOpened(EventContext context, MessageOpenedEvent @event)
        {
            context.ThrowIfNull("context");
            @event.ThrowIfNull("event");

            return _eventHandlerCollection.SafeInvoke(context, @event);
        }