/**
 * Copyright(c) Live2D Inc. All rights reserved.
 *
 * Use of this source code is governed by the Live2D Open Software license
 * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
 */ import { CubismIdHandle } from '../id/cubismid' ; import { CubismFramework } from '../live2dcubismframework' ; import { CubismJson } from '../utils/cubismjson' ; const Meta = 'Meta' ; const UserDataCount = 'UserDataCount' ; const TotalUserDataSize = 'TotalUserDataSize' ; const UserData = 'UserData' ; const Target = 'Target' ; const Id = 'Id' ; const Value = 'Value' ; export class CubismModelUserDataJson { param buffer param size public constructor ( buffer , size ) { this . _json = CubismJson . create ( buffer , size ) ; } /**
     * デストラクタ相当の処理
     */ public release ( ) { CubismJson . delete ( this . _json ) ; } return public getUserDataCount ( ) { return this . _json . getRoot ( ) . getValueByString ( Meta ) . getValueByString ( UserDataCount ) . toInt ( ) ; } return public getTotalUserDataSize ( ) { return this . _json . getRoot ( ) . getValueByString ( Meta ) . getValueByString ( TotalUserDataSize ) . toInt ( ) ; } return public getUserDataTargetType ( i ) { return this . _json . getRoot ( ) . getValueByString ( UserData ) . getValueByIndex ( i ) . getValueByString ( Target ) . getRawString ( ) ; } param i return public getUserDataId ( i ) { return CubismFramework . getIdManager ( ) . getId ( this . _json . getRoot ( ) . getValueByString ( UserData ) . getValueByIndex ( i ) . getValueByString ( Id ) . getRawString ( ) ) ; } param i return public getUserDataValue ( i ) { return this . _json . getRoot ( ) . getValueByString ( UserData ) . getValueByIndex ( i ) . getValueByString ( Value ) . getRawString ( ) ; } private _json : CubismJson ; } import * as $ from './cubismmodeluserdatajson' ; export namespace Live2DCubismFramework { export const CubismModelUserDataJson = $ . CubismModelUserDataJson ; export type CubismModelUserDataJson = $ . CubismModelUserDataJson ; }