Example #1
0
 protected override Validation <string, SitAction> CreateService(
     string key, string displayName, ILoggerFactory loggerFactory)
 {
     return
         (from animation in Prelude.Optional(Animation)
          .ToValidation("Animation was not specified.")
          from statesPath in StatesPath.TrimToOption()
          .ToValidation("States path was not specified.")
          from subStatesPath in SubStatesPath.TrimToOption()
          .ToValidation("Sub-states path was not specified.")
          from idleState in IdleState.TrimToOption()
          .ToValidation("Idle state value was not specified.")
          from enterState in EnterState.TrimToOption()
          .ToValidation("Enter state value was not specified.")
          from state in State.TrimToOption()
          .ToValidation("State path was not specified.")
          from exitState in ExitState.TrimToOption()
          .ToValidation("Exit state value was not specified.")
          from enterAnimatorPath in EnterAnimatorPath.TrimToOption()
          .ToValidation("Enter animator path was not specified.")
          from animatorPath in AnimatorPath.TrimToOption()
          .ToValidation("Animator path was not specified.")
          from exitAnimatorPath in ExitAnimatorPath.TrimToOption()
          .ToValidation("Exit animator path was not specified.")
          select new SitAction(
              key,
              displayName,
              animation,
              statesPath,
              subStatesPath,
              idleState,
              enterState,
              state,
              exitState,
              enterAnimatorPath,
              animatorPath,
              exitAnimatorPath,
              Active,
              loggerFactory)
     {
         SittingDownAnimation = SittingDownAnimation,
         GettingUpAnimation = GettingUpAnimation
     });
 }
Example #2
0
 protected override Validation <string, GetUpAction> CreateService(
     string key, string displayName, ILoggerFactory loggerFactory)
 {
     return
         (from statesPath in StatesPath.TrimToOption()
          .ToValidation("States path was not specified.")
          from subStatesPath in SubStatesPath.TrimToOption()
          .ToValidation("Sub-states path was not specified.")
          from state in State.TrimToOption()
          .ToValidation("State path was not specified.")
          from exitState in ExitState.TrimToOption()
          .ToValidation("Exit state value was not specified.")
          select new GetUpAction(
              key,
              displayName,
              statesPath,
              subStatesPath,
              state,
              exitState,
              Active,
              loggerFactory));
 }