Polish implementation
parent
8040d3fc6b
commit
bec7c21ac4
|
@ -8,7 +8,6 @@
|
|||
import { CubismIdHandle } from '../id/cubismid';
|
||||
import { CubismFramework } from '../live2dcubismframework';
|
||||
import { csmString } from '../type/csmstring';
|
||||
import { csmVector } from '../type/csmvector';
|
||||
import { CubismJson } from '../utils/cubismjson';
|
||||
|
||||
// JSON keys
|
||||
|
@ -226,12 +225,12 @@ export class CubismMotionJson {
|
|||
* @return false 存在しない
|
||||
*/
|
||||
public isExistMotionCurveFadeInTime(curveIndex: number): boolean {
|
||||
const value = this._json
|
||||
return !this._json
|
||||
.getRoot()
|
||||
.getValueByString(Curves)
|
||||
.getValueByIndex(curveIndex)
|
||||
.getValueByString(FadeInTime);
|
||||
return !(value.isNull() || value.isError());
|
||||
.getValueByString(FadeInTime)
|
||||
.isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,12 +240,12 @@ export class CubismMotionJson {
|
|||
* @return false 存在しない
|
||||
*/
|
||||
public isExistMotionCurveFadeOutTime(curveIndex: number): boolean {
|
||||
const value = this._json
|
||||
return !this._json
|
||||
.getRoot()
|
||||
.getValueByString(Curves)
|
||||
.getValueByIndex(curveIndex)
|
||||
.getValueByString(FadeOutTime);
|
||||
return !(value.isNull() || value.isError());
|
||||
.getValueByString(FadeOutTime)
|
||||
.isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -288,7 +287,7 @@ export class CubismMotionJson {
|
|||
.getValueByString(Curves)
|
||||
.getValueByIndex(curveIndex)
|
||||
.getValueByString(Segments)
|
||||
.getVector(new csmVector())
|
||||
.getVector()
|
||||
.getSize();
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ export abstract class Value {
|
|||
/**
|
||||
* 要素をコンテナで返す(array)
|
||||
*/
|
||||
public getVector(defaultValue?: csmVector<Value>): csmVector<Value> {
|
||||
public getVector(defaultValue = new csmVector<Value>()): csmVector<Value> {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
@ -192,11 +192,8 @@ export abstract class Value {
|
|||
public static staticInitializeNotForClientCall(): void {
|
||||
JsonBoolean.trueValue = new JsonBoolean(true);
|
||||
JsonBoolean.falseValue = new JsonBoolean(false);
|
||||
|
||||
JsonError.errorValue = new JsonError('ERROR', true);
|
||||
this.nullValue = new JsonNullvalue();
|
||||
this.errorValue = new JsonError('ERROR', true);
|
||||
|
||||
Value.errorValue = new JsonError('ERROR', true);
|
||||
Value.nullValue = new JsonNullvalue();
|
||||
Value.s_dummyKeys = new csmVector<string>();
|
||||
}
|
||||
|
||||
|
@ -206,13 +203,7 @@ export abstract class Value {
|
|||
public static staticReleaseNotForClientCall(): void {
|
||||
JsonBoolean.trueValue = null;
|
||||
JsonBoolean.falseValue = null;
|
||||
JsonError.errorValue = null;
|
||||
Value.nullValue = null;
|
||||
Value.s_dummyKeys = null;
|
||||
|
||||
JsonBoolean.trueValue = null;
|
||||
JsonBoolean.falseValue = null;
|
||||
JsonError.errorValue = null;
|
||||
Value.errorValue = null;
|
||||
Value.nullValue = null;
|
||||
Value.s_dummyKeys = null;
|
||||
}
|
||||
|
@ -971,6 +962,14 @@ export class JsonNullvalue extends Value {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valueにエラー値をセットする
|
||||
*/
|
||||
public setErrorNotForClientCall(s: string): Value {
|
||||
this._stringBuffer = s;
|
||||
return JsonError.nullValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue