Actions aren't really attributes in Caves of Zircon, they're a code smell which means something may be missing
BobG1983 opened this issue · 3 comments
Caves of Zircon has an attribute called Actions which is a command container, which is basically a special case of
if(hasAttribute)
dispatchCommandOnOtherEntity
Its a useful construct, but it feels like its a code smell and something is missing.
Actions could be hoisted up to be equivalent to facets, behaviors etc. but then you could only trigger them all. So having different triggers (bump vs shoot vs eat for example) wouldn’t work. Is there some missing concept?
Or is this the least worst idea?
My gut is that this may change once we have single command facets and global systems solved
I agree. I think I'll draw a diagram with all these things, and write some examples just to give ourselves some ammunition for thinking about this.
You were right, the Facet
composition is a good solution to create a command dispatcher and we can just send specific Command
s to an Entity
when we want to try its actions so this:
result = entity.tryActionsOn(context, block.occupier.get())
we can do
result = entity.executeCommand(TryAction(context, block.occupier.get())