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;
        }
Exemple #2
0
        protected internal virtual EventResult OnTouchedByActorInstance(EventContext context, ActorInstanceTouchedPlayerEvent @event)
        {
            context.ThrowIfNull("context");
            @event.ThrowIfNull("event");

            return _eventHandlerCollection.SafeInvoke(context, @event);
        }
        protected internal virtual EventResult OnMoved(EventContext context, ActorInstanceMovedEvent @event)
        {
            context.ThrowIfNull("context");
            @event.ThrowIfNull("event");

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

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