import { SaveFileReader } from "../../save-file/SaveFileReader" ; import { parseItemList } from "../../items/parsing/parseItemList" ; import { Character } from "../types" ; export function parseMercenary ( reader , character ) { const header = reader . readString ( 2 ) ; if ( header !== "jf" ) { throw new Error ( `Unexpected header ${ header } for mercenary data` ) ; } if ( character . hasMercenary ) { const items = parseItemList ( reader , character ) ; for ( const item of items ) { item . mercenary = true ; } character . items . push ( ... items ) ; } }