(type, parserFn)
| 355 | * @category Assets |
| 356 | */ |
| 357 | export function setParser(type, parserFn) { |
| 358 | if (typeof parserFn !== "function") { |
| 359 | throw new Error("invalid parser function for " + type); |
| 360 | } |
| 361 | |
| 362 | if (typeof parsers.get(type) !== "undefined") { |
| 363 | warning("overriding parser for " + type + " format"); |
| 364 | } |
| 365 | |
| 366 | parsers.set(type, parserFn); |
| 367 | } |
| 368 | |
| 369 | /** |
| 370 | * set all the specified game assets to be preloaded. |
no test coverage detected