move some files around, organize imports
This commit is contained in:
parent
07e76733ec
commit
1b2851353e
|
@ -2,9 +2,10 @@ import { log, LogTypes as LT } from '@Log4Deno';
|
|||
|
||||
import config from '~config';
|
||||
|
||||
import { tokenizeMath } from 'artigen/mathTokenizer.ts';
|
||||
import { CountDetails, ReturnData } from 'artigen/solver.d.ts';
|
||||
|
||||
import { tokenizeMath } from 'artigen/math/mathTokenizer.ts';
|
||||
|
||||
import { closeInternal, internalWrapRegex, openInternal } from 'artigen/utils/escape.ts';
|
||||
import { loggingEnabled } from 'artigen/utils/logFlag.ts';
|
||||
import { getMatchingInternalIdx, getMatchingPostfixIdx } from 'artigen/utils/parenBalance.ts';
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import { log, LogTypes as LT } from '@Log4Deno';
|
||||
|
||||
import { rollCounter } from './utils/counter.ts';
|
||||
import { RollModifiers } from 'src/mod.d.ts';
|
||||
import { executeRoll } from 'artigen/executeRoll.ts';
|
||||
import { RollFormat } from 'artigen/solver.d.ts';
|
||||
|
||||
import { executeRoll } from 'artigen/dice/executeRoll.ts';
|
||||
|
||||
import { rollCounter } from 'artigen/utils/counter.ts';
|
||||
import { loggingEnabled } from 'artigen/utils/logFlag.ts';
|
||||
|
||||
import { RollModifiers } from 'src/mod.d.ts';
|
||||
|
||||
// generateSolvedRoll(rollConf, modifiers) returns one SolvedStep
|
||||
// generateSolvedRoll handles creating and formatting the completed rolls into the SolvedStep format
|
||||
export const generateSolvedRoll = (rollConf: string, modifiers: RollModifiers): RollFormat => {
|
|
@ -1,9 +1,11 @@
|
|||
import { log, LogTypes as LT } from '@Log4Deno';
|
||||
|
||||
import { generateSolvedRoll } from 'artigen/generateSolvedRoll.ts';
|
||||
import { mathSolver } from 'artigen/mathSolver.ts';
|
||||
import { CountDetails, MathConf, ReturnData, SolvedStep } from 'artigen/solver.d.ts';
|
||||
|
||||
import { generateSolvedRoll } from 'artigen/dice/generateSolvedRoll.ts';
|
||||
|
||||
import { mathSolver } from 'artigen/math/mathSolver.ts';
|
||||
|
||||
import { cmdSplitRegex, internalWrapRegex } from 'artigen/utils/escape.ts';
|
||||
import { legalMathOperators } from 'artigen/utils/legalMath.ts';
|
||||
import { loggingEnabled } from 'artigen/utils/logFlag.ts';
|
||||
|
@ -100,7 +102,7 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData
|
|||
containsCrit: false,
|
||||
containsFail: false,
|
||||
},
|
||||
],
|
||||
]
|
||||
);
|
||||
i += 2;
|
||||
} else if (!legalMathOperators.includes(strMathConfI) && legalMathOperators.some((mathOp) => strMathConfI.endsWith(mathOp))) {
|
||||
|
@ -126,10 +128,10 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData
|
|||
} else {
|
||||
// Handle normally, just set current item to negative
|
||||
if (typeof mathConf[i] === 'number') {
|
||||
mathConf[i] = <number> mathConf[i] * -1;
|
||||
mathConf[i] = <number>mathConf[i] * -1;
|
||||
} else {
|
||||
(<SolvedStep> mathConf[i]).total = (<SolvedStep> mathConf[i]).total * -1;
|
||||
(<SolvedStep> mathConf[i]).details = `-${(<SolvedStep> mathConf[i]).details}`;
|
||||
(<SolvedStep>mathConf[i]).total = (<SolvedStep>mathConf[i]).total * -1;
|
||||
(<SolvedStep>mathConf[i]).details = `-${(<SolvedStep>mathConf[i]).details}`;
|
||||
}
|
||||
mathConf.splice(i - 1, 1);
|
||||
i--;
|
Loading…
Reference in New Issue