Started fixing action target selection
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import Task from '/imports/api/engine/action/tasks/Task';
|
||||
|
||||
type InputProvider = {
|
||||
/**
|
||||
* Get the ids of the creatures being targeted
|
||||
*/
|
||||
targetIds(target: 'singleTarget' | 'multipleTargets', currentTargetIds?: string[]): Promise<string[]>;
|
||||
/**
|
||||
* Show the user the next property or task to apply and wait for input to continue
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,9 @@ export default function getReplayChoicesInputProvider(actionId: string, decision
|
||||
const decisionStack = [...decisions].reverse();
|
||||
const dRoller = getDeterministicDiceRoller(actionId);
|
||||
const replaySavedInput: InputProvider = {
|
||||
targetIds() {
|
||||
return Promise.resolve(decisionStack.pop());
|
||||
},
|
||||
nextStep() {
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import InputProvider from '/imports/api/engine/action/functions/userInput/InputProvider';
|
||||
|
||||
const inputProviderForTests: InputProvider = {
|
||||
async targetIds(target, currentTargetIds = []) {
|
||||
return currentTargetIds;
|
||||
},
|
||||
/**
|
||||
* For testing, randomness is hard to deal with
|
||||
* rollDice function returns the average roll for every dice rolled
|
||||
|
||||
Reference in New Issue
Block a user