import { binaryStream } from "../../save-file/binary" ; import { ITEM_STATS } from "../../../game-data" ; import { SaveFileReader } from "../../save-file/SaveFileReader" ; export function parseAttributes ( reader ) { const header = reader . readString ( 2 , 765 ) ; if ( header !== "gf" ) { throw new Error ( `Unexpected header ${ header } for an attributes list` ) ; } const stream = binaryStream ( reader ) ; let attribute ; while ( ( attribute = stream . readInt ( 9 ) ) !== 511 ) { stream . readInt ( ITEM_STATS [ attribute ] ?. charSize ?? 0 ) ; } }