{"version":3,"file":"resource-matchers.mjs","names":[],"sources":["../../src/helpers/resource-matchers.ts"],"sourcesContent":["import {\n  Resource,\n  ResourceTypes,\n  type ResourceMap,\n  type ResourceType,\n} from '@4bitlabs/sci0';\nimport type { ResourceMapPredicate } from '../actions/load-content-from-map.js';\n\nexport const createMatcherForType =\n  (resType: ResourceType) =>\n  (resId: number): ResourceMapPredicate =>\n  ({ id }: ResourceMap) =>\n    Resource.getType(id) === resType && Resource.getNumber(id) === resId;\n\nexport const picMatcher = createMatcherForType(ResourceTypes.PIC_TYPE);\nexport const viewMatcher = createMatcherForType(ResourceTypes.VIEW_TYPE);\nexport const fontMatcher = createMatcherForType(ResourceTypes.FONT_TYPE);\nexport const cursorMatcher = createMatcherForType(ResourceTypes.CURSOR_TYPE);\n"],"mappings":";;AAQA,MAAa,wBACV,aACA,WACA,EAAE,SACD,SAAS,QAAQ,EAAE,MAAM,WAAW,SAAS,UAAU,EAAE,MAAM;AAEnE,MAAa,aAAa,qBAAqB,cAAc,QAAQ;AACrE,MAAa,cAAc,qBAAqB,cAAc,SAAS;AACvE,MAAa,cAAc,qBAAqB,cAAc,SAAS;AACvE,MAAa,gBAAgB,qBAAqB,cAAc,WAAW"}