(pointer: ScriptPointer | ScriptPointer[], handler: CommandHandler)
| 45 | * @param handler The handler to run after checking the pointer. |
| 46 | */ |
| 47 | export function checkedHandler(pointer: ScriptPointer | ScriptPointer[], handler: CommandHandler) { |
| 48 | return function (state: ScriptState) { |
| 49 | if (typeof pointer === 'number') { |
| 50 | state.pointerCheck(pointer); |
| 51 | } else { |
| 52 | state.pointerCheck(pointer[state.intOperand]); |
| 53 | } |
| 54 | handler(state); |
| 55 | }; |
| 56 | } |
| 57 | |
| 58 | export default ScriptPointer; |
no test coverage detected