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