示例#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;
 }
示例#2
0
 public RequestHandler(
     TripleTriadDbContext context,
     IStepHandler <PlayCardStep> playCardHandler)
 {
     this.context         = context;
     this.playCardHandler = playCardHandler;
 }
 /// <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;
 }
示例#4
0
 public static GameData ValidateAndRun <TStep>(
     this IStepHandler <TStep> handler,
     TStep step)
     where TStep : Step
 {
     handler.ValidateAndThrow(step);
     return(handler.Run(step));
 }
示例#5
0
        public static GameData Run(
            this IStepHandler <CreateBoardStep> handler,
            GameData data)
        {
            var step = new CreateBoardStep(data);

            return(handler.ValidateAndRun(step));
        }
示例#6
0
 public RequestHandler(
     TripleTriadDbContext context,
     IStepHandler <CoinTossStep> coinTossHandler,
     IStepHandler <CreateBoardStep> createBoardHandler)
 {
     this.context            = context;
     this.coinTossHandler    = coinTossHandler;
     this.createBoardHandler = createBoardHandler;
 }
示例#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));
        }
示例#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));
        }
示例#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));
        }
示例#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;
            }
        }
示例#11
0
 public RequestHandler(TripleTriadDbContext context, IStepHandler <SelectCardsStep> selectCardHandler)
 {
     this.context           = context;
     this.selectCardHandler = selectCardHandler;
 }