-
Notifications
You must be signed in to change notification settings - Fork 0
CastingEnvironmentComponentJS
YukkuriC edited this page Sep 4, 2026
·
2 revisions
vanilla but in JS, with more convenient Key creation
- each component takes a key string as the first constructor arg, from which the
Keyis auto-created & cached (setKeyto change it later) - available components (functionality same as vanilla):
ExtractMedia(Pre/Post),PostCast,PostExecution,IsVecInRange,HasEditPermissionsAt
a simple example of pattern, making the cast access all positions regardlessly
let { ActionRegistryJS, CastingEnvironmentComponentJS: CastEnvJS } = HexJS
ActionRegistryJS.of(
HexPattern.fromAnglesUnchecked('wqwqwqwawewewewewewdwqqaeaaeq', HexDir.WEST),
'yc:i_see_all',
1,
).setOperate(ctx => {
// we don't care, just make everything in range
ctx.addExtension(new CastEnvJS.IsVecInRange('i_see_all', () => true))
})