MatchUp Actions
See Actions for context.
matchUpActions
returns an array of valid actions for a specified matchUpId
. Valid actions can be determined, in part, by
policyDefinitions
. In the Competition Factory source there are four examples of matchUp action policies:
- Default position actions
- No movement (disallows swapping participants & etc.)
- Disabled position actions
- Unrestricted position actions (all available actions)
const {
isByeMatchUp, // boolean; true if matchUp includes a BYE
structureIsComplete, // boolean; true if structure is ready for positioning
validActions, // array of possible actions given current matchUpStatus
} = askEngine.matchUpActions({
restrictAdHocRoundParticipants, // optional - true by default; applies to AD_HOC; disallow the same participant being in the same round multiple times
sideNumber, // optional - select side to which action should apply; applies to AD_HOC position assignments
matchUpId, // required - reference to targeted matchUp
drawId, // optional - not strictly required; method will find matchUp by brute force without it
});
const {
type, // 'REFEREE', 'SCHEDULE', 'PENALTY', 'STATUS', 'SCORE', 'START', 'END', 'SUBSTITUTION'.
method, // engine method relating to action type
payload, // attributes to be passed to method
// additional method-specific options for values to be added to payload when calling method
} = validAction;
policyDefinitions Example
- {}▶
- {}▶