feat: spawn key options

This commit is contained in:
cha0s 2020-06-23 22:14:41 -05:00
parent a32159cee9
commit 3628abde5c

View File

@ -14,6 +14,8 @@ const decorate = compose(
export default class Spawner extends decorate(Trait) {
static behaviorTypes() {
const spawnKeys = (entity) => Object.keys(entity.traitInstance('spawner').params.spawns)
.reduce((r, key) => ({...r, [key]: key}), {})
return {
killAllChildren: {
type: 'void',
@ -26,6 +28,7 @@ export default class Spawner extends decorate(Trait) {
args: [
['key', {
type: 'string',
options: spawnKeys,
}],
['json', {
type: 'object',
@ -39,6 +42,7 @@ export default class Spawner extends decorate(Trait) {
args: [
['key', {
type: 'string',
options: spawnKeys,
}],
['position', {
type: 'vector',