Exemplo n.º 1
0
 /// <summary>
 /// Custom constructor using a job repository, a step hander and a job execution.
 /// </summary>
 /// <param name="jobRepository"></param>
 /// <param name="stepHandler"></param>
 /// <param name="execution"></param>
 public JobFlowExecutor(IJobRepository jobRepository, IStepHandler stepHandler, JobExecution execution)
 {
     _jobRepository             = jobRepository;
     _stepHandler               = stepHandler;
     _execution                 = execution;
     _stepExecutionHolder.Value = null;
 }
Exemplo n.º 2
0
 public RequestHandler(
     TripleTriadDbContext context,
     IStepHandler <PlayCardStep> playCardHandler)
 {
     this.context         = context;
     this.playCardHandler = playCardHandler;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Custom constructor using a job repository, a step hander and a job execution.
 /// </summary>
 /// <param name="jobRepository"></param>
 /// <param name="stepHandler"></param>
 /// <param name="execution"></param>
 public JobFlowExecutor(IJobRepository jobRepository, IStepHandler stepHandler, JobExecution execution)
 {
     _jobRepository = jobRepository;
     _stepHandler = stepHandler;
     _execution = execution;
     _stepExecutionHolder.Value = null;
 }
Exemplo n.º 4
0
 public static GameData ValidateAndRun <TStep>(
     this IStepHandler <TStep> handler,
     TStep step)
     where TStep : Step
 {
     handler.ValidateAndThrow(step);
     return(handler.Run(step));
 }
Exemplo n.º 5
0
        public static GameData Run(
            this IStepHandler <CreateBoardStep> handler,
            GameData data)
        {
            var step = new CreateBoardStep(data);

            return(handler.ValidateAndRun(step));
        }
Exemplo n.º 6
0
 public RequestHandler(
     TripleTriadDbContext context,
     IStepHandler <CoinTossStep> coinTossHandler,
     IStepHandler <CreateBoardStep> createBoardHandler)
 {
     this.context            = context;
     this.coinTossHandler    = coinTossHandler;
     this.createBoardHandler = createBoardHandler;
 }
Exemplo n.º 7
0
        public static GameData Run(
            this IStepHandler <CoinTossStep> handler,
            GameData data,
            string hostDispay,
            string challengerDisplay)
        {
            var step = new CoinTossStep(data, hostDispay, challengerDisplay);

            return(handler.ValidateAndRun(step));
        }
Exemplo n.º 8
0
        public static GameData Run(
            this IStepHandler <PlayCardStep> handler,
            GameData data,
            string card,
            int tileId,
            bool isHost)
        {
            var step = new PlayCardStep(data, card, tileId, isHost);

            return(handler.ValidateAndRun(step));
        }
Exemplo n.º 9
0
        public static GameData Run(
            this IStepHandler <SelectCardsStep> handler,
            GameData data,
            bool isHost,
            string playerDisplay,
            IEnumerable <string> cards)
        {
            var step = new SelectCardsStep(data, isHost, playerDisplay, cards);

            return(handler.ValidateAndRun(step));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="stepDef"></param>
        public StepRuntime(StepDefinition stepDef, LinkRuntime[] outgoingLinks)
        {
            _stepDef = stepDef;
            OutLinks = outgoingLinks;
            switch (_stepDef.StepHandler.StepHandlerType)
            {
            case StepHandlerTypeEnum.None: _handler = new EmptyHandler(); break;

            case StepHandlerTypeEnum.IoC: _handler = new IoCServiceHandler(this); break;

            case StepHandlerTypeEnum.Task: _handler = new TaskServiceHandler(this); break;

            case StepHandlerTypeEnum.Script: _handler = new ScriptHandler(this); break;

            case StepHandlerTypeEnum.Service: _handler = new AsmLoadHandler(this); break;
            }
        }
Exemplo n.º 11
0
 public RequestHandler(TripleTriadDbContext context, IStepHandler <SelectCardsStep> selectCardHandler)
 {
     this.context           = context;
     this.selectCardHandler = selectCardHandler;
 }