Action<State, System, T, R> constructor

Action<State, System, T, R>(
  1. String description,
  2. Arbitrary<T>? arbitrary, {
  3. required void nextState(
    1. State,
    2. T
    ),
  4. required R run(
    1. System,
    2. T
    ),
  5. bool precondition(
    1. State,
    2. T
    )?,
  6. bool postcondition(
    1. State,
    2. T,
    3. R
    )?,
})

Creates a new action command.

Parameters:

  • description: The description of the action.
  • arbitrary: The arbitrary used to generate values.
  • run: A function to perform the action.
  • precondition: A function to test the precondition of the action.
  • postcondition: A function to test the postcondition of the action.

Implementation

Action(
  super.description,
  this.arbitrary, {
  required void Function(State, T) nextState,
  required R Function(System, T) run,
  bool Function(State, T)? precondition,
  bool Function(State, T, R)? postcondition,
}) {
  _nextState = nextState;
  _run = run;
  _precondition = precondition;
  _postcondition = postcondition;
}