Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 105x 117x 13x 104x | /** * Exports object instance switch/variable access function. * * @module object-instance/resolve-id.function */ import type { AgtkObjectInstance } from '@agogpixel/pgmmv-ts/api/agtk/object-instance/object-instance'; import type { ObjectInstanceAccessorType } from './object-instance-accessor-type.enum'; /** * Resolve switch or variable ID. * * @param objectInstance Object instance. * @param type Accessor type. * @param idOrName ID or name of switch/variable. * @returns ID or -1 when name not found. */ export function resolveId( objectInstance: AgtkObjectInstance, type: ObjectInstanceAccessorType, idOrName: number | string ) { if (typeof idOrName === 'string') { return objectInstance[type].getIdByName(idOrName); } return idOrName; } |