Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
accessorizerBehavior => {
if(!accessorizerBehavior) return null;
const accessory = getAccessoryOfType(accessorizerBehavior.parsedData.accessories, type);
if (!accessory) return null;
return accessory.guid.Guid;
}
);
render() {
const { duplicant } = this.props;
const accessorizer = duplicant.getBehavior(AccessorizerBehavior);
if (!accessorizer) return <div>Error: No AccessorizerBehavior found</div>;
const accessories = accessorizer.templateData.accessories;
const eyesAccessory = getAccessoryOfType(accessories, "eyes");
const headAccessory = getAccessoryOfType(accessories, "headshape");
const hairAccessory = getAccessoryOfType(accessories, "hair");
const mouthAccessory = getAccessoryOfType(accessories, "mouth");
const bodyAccessory = getAccessoryOfType(accessories, "body");
const eyes = eyesAccessory ? eyesAccessory.guid.Guid : "[Error: Accessory Not Found]";
const head = headAccessory ? headAccessory.guid.Guid : "[Error: Accessory Not Found]";
const hair = hairAccessory ? hairAccessory.guid.Guid : "[Error: Accessory Not Found]";
const mouth = mouthAccessory ? mouthAccessory.guid.Guid : "[Error: Accessory Not Found]";
const body = bodyAccessory ? bodyAccessory.guid.Guid : "[Error: Accessory Not Found]";
return (
<div>
</div>
render() {
const { duplicant } = this.props;
const accessorizer = duplicant.getBehavior(AccessorizerBehavior);
if (!accessorizer) return <div>Error: No AccessorizerBehavior found</div>;
const accessories = accessorizer.templateData.accessories;
const eyesAccessory = getAccessoryOfType(accessories, "eyes");
const headAccessory = getAccessoryOfType(accessories, "headshape");
const hairAccessory = getAccessoryOfType(accessories, "hair");
const mouthAccessory = getAccessoryOfType(accessories, "mouth");
const bodyAccessory = getAccessoryOfType(accessories, "body");
const eyes = eyesAccessory ? eyesAccessory.guid.Guid : "[Error: Accessory Not Found]";
const head = headAccessory ? headAccessory.guid.Guid : "[Error: Accessory Not Found]";
const hair = hairAccessory ? hairAccessory.guid.Guid : "[Error: Accessory Not Found]";
const mouth = mouthAccessory ? mouthAccessory.guid.Guid : "[Error: Accessory Not Found]";
const body = bodyAccessory ? bodyAccessory.guid.Guid : "[Error: Accessory Not Found]";
return (
<div>
</div>
);
style={{
left: 126 * scale,
top: 150 * scale,
transform: `scale(${scale})`
}}
>
render() {
const { duplicant } = this.props;
const accessorizer = duplicant.getBehavior(AccessorizerBehavior);
if (!accessorizer) return <div>Error: No AccessorizerBehavior found</div>;
const accessories = accessorizer.templateData.accessories;
const eyesAccessory = getAccessoryOfType(accessories, "eyes");
const headAccessory = getAccessoryOfType(accessories, "headshape");
const hairAccessory = getAccessoryOfType(accessories, "hair");
const mouthAccessory = getAccessoryOfType(accessories, "mouth");
const bodyAccessory = getAccessoryOfType(accessories, "body");
const eyes = eyesAccessory ? eyesAccessory.guid.Guid : "[Error: Accessory Not Found]";
const head = headAccessory ? headAccessory.guid.Guid : "[Error: Accessory Not Found]";
const hair = hairAccessory ? hairAccessory.guid.Guid : "[Error: Accessory Not Found]";
const mouth = mouthAccessory ? mouthAccessory.guid.Guid : "[Error: Accessory Not Found]";
const body = bodyAccessory ? bodyAccessory.guid.Guid : "[Error: Accessory Not Found]";
return (
<div>
</div>
render() {
const { duplicant } = this.props;
const accessorizer = duplicant.getBehavior(AccessorizerBehavior);
if (!accessorizer) return <div>Error: No AccessorizerBehavior found</div>;
const accessories = accessorizer.templateData.accessories;
const eyesAccessory = getAccessoryOfType(accessories, "eyes");
const headAccessory = getAccessoryOfType(accessories, "headshape");
const hairAccessory = getAccessoryOfType(accessories, "hair");
const mouthAccessory = getAccessoryOfType(accessories, "mouth");
const bodyAccessory = getAccessoryOfType(accessories, "body");
const eyes = eyesAccessory ? eyesAccessory.guid.Guid : "[Error: Accessory Not Found]";
const head = headAccessory ? headAccessory.guid.Guid : "[Error: Accessory Not Found]";
const hair = hairAccessory ? hairAccessory.guid.Guid : "[Error: Accessory Not Found]";
const mouth = mouthAccessory ? mouthAccessory.guid.Guid : "[Error: Accessory Not Found]";
const body = bodyAccessory ? bodyAccessory.guid.Guid : "[Error: Accessory Not Found]";
return (
<div>
</div>
function getOrdinalOfType(
accessories: Accessory[],
type: AccessoryType
): number {
const accessory = getAccessoryOfType(accessories, type);
if (accessory == null) {
return 1;
}
return ordinalFromAccessory(accessory.guid.Guid);
}
return createSelector(accessorizerBehavior, behavior => {
if (!behavior) {
return null;
}
const { accessories } = behavior.templateData;
const accessory = getAccessoryOfType(accessories, accessoryType);
if (!accessory) {
return null;
}
return getAccessoryName(accessory);
});
}