Sorted actions
Sort actions by order of execution (STAY -> DESTROY -> BUILD -> MOVE)
const actions = [
{
craftsman_id: '1',
action: 'BUILD',
action_param: 'BELOW',
},
{
craftsman_id: '2',
action: 'MOVE',
action_param: 'UPPER_RIGHT',
},
{
craftsman_id: '3',
action: 'STAY',
},
];
sortActions(actions);
// [
// {
// craftsman_id: '3',
// action: 'STAY',
// },
// {
// craftsman_id: '1',
// action: 'BUILD',
// action_param: 'BELOW',
// },
// {
// craftsman_id: '2',
// action: 'MOVE',
// action_param: 'UPPER_RIGHT',
// },
// ]
Generated using TypeDoc
Actions to sort