Mod behavior model add cache object
This commit is contained in:
parent
8607dcd3da
commit
dec18361ef
@ -6,6 +6,11 @@ import type { Model } from "./Model";
|
|||||||
import type { Range } from "./Range";
|
import type { Range } from "./Range";
|
||||||
import type { Label } from "./Label";
|
import type { Label } from "./Label";
|
||||||
|
|
||||||
|
type IObjectParamCacheType<P, Q = P> = {
|
||||||
|
picker: P;
|
||||||
|
objects: Q;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数类型
|
* 参数类型
|
||||||
*/
|
*/
|
||||||
@ -16,12 +21,10 @@ type IMapBasicParamTypeKeyToType = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IMapObjectParamTypeKeyToType = {
|
type IMapObjectParamTypeKeyToType = {
|
||||||
"R"?: Range;
|
"R": IObjectParamCacheType<Range | undefined>;
|
||||||
"G"?: Group;
|
"G": IObjectParamCacheType<Group | undefined>;
|
||||||
"GR"?: Group | Range;
|
"LR": IObjectParamCacheType<Label | Range | undefined, Range[]>;
|
||||||
"LR"?: Label | Range;
|
"LG": IObjectParamCacheType<Label | Group | undefined, Range[]>;
|
||||||
"LG"?: Label | Group;
|
|
||||||
"LGR"?: Label | Group | Range;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type IMapVectorParamTypeKeyToType = {
|
type IMapVectorParamTypeKeyToType = {
|
||||||
@ -40,7 +43,7 @@ type IParamValue<K extends IParamType> = AllMapType[K];
|
|||||||
/**
|
/**
|
||||||
* 特殊对象类型判定
|
* 特殊对象类型判定
|
||||||
*/
|
*/
|
||||||
const objectTypeListEnumSet = new Set<IParamType>(["R", "G", "GR", "LR", "LG", "LGR"]);
|
const objectTypeListEnumSet = new Set<IParamType>(["R", "G", "LR", "LG"]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象断言表达式
|
* 对象断言表达式
|
||||||
@ -247,6 +250,22 @@ class BehaviorRecorder<
|
|||||||
case "vec":
|
case "vec":
|
||||||
defaultObj[key] = [0, 0, 0] as any;
|
defaultObj[key] = [0, 0, 0] as any;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "G":
|
||||||
|
case "R":
|
||||||
|
defaultObj[key] = {
|
||||||
|
picker: undefined,
|
||||||
|
objects: undefined
|
||||||
|
} as any;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "LR":
|
||||||
|
case "LG":
|
||||||
|
defaultObj[key] = {
|
||||||
|
picker: undefined,
|
||||||
|
objects: []
|
||||||
|
} as any;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user