diff --git a/app/ecs/components/index.js b/app/ecs/components/index.js index d077722..f83fb51 100644 --- a/app/ecs/components/index.js +++ b/app/ecs/components/index.js @@ -6,9 +6,13 @@ const Gathered = gather( const Components = {}; for (const componentName in Gathered) { - Components[componentName] = class Named extends Gathered[componentName] { - static componentName = componentName; - }; + Components[componentName] = eval(` + ((Gathered) => ( + class ${componentName} extends Gathered['${componentName}'] { + static componentName = '${componentName}'; + } + )) + `)(Gathered); } export default Components;