@casual-simulation/aux-runtime
Version:
Runtime for AUX projects
53 lines • 1.75 kB
JavaScript
import { hasValue } from '@casual-simulation/aux-common/bots';
import { v4 as uuid } from 'uuid';
/**
* Creates a new compiled bot with the given values.
* Useful for testing.
* @param id The ID of the bot.
* @param values The values that the bot contains.
* @param tags The tags that the bot contains.
* @param space The space that the bot is in.
* @param compiledValues The compiled values that the bot should use.
* @param listeners The listeners that the bot should have.
* @param modules The modules that the bot should have.
*/
export function createCompiledBot(id = uuid(), values = {}, tags, space, listeners = {}, signatures, modules = {}, dynamicListeners = {}, listenerOverrides = {}) {
if (hasValue(space)) {
return {
id,
space,
precalculated: true,
tags: tags || values,
values,
listeners: listeners,
listenerOverrides: listenerOverrides,
dynamicListeners: dynamicListeners,
modules: modules,
exports: {},
signatures,
script: null,
originalTagEditValues: {},
originalTagMaskEditValues: {},
breakpoints: [],
errorCounts: {},
};
}
return {
id,
precalculated: true,
tags: tags || values,
values,
listeners: listeners,
listenerOverrides: listenerOverrides,
dynamicListeners: dynamicListeners,
modules: modules,
exports: {},
signatures,
script: null,
originalTagEditValues: {},
originalTagMaskEditValues: {},
breakpoints: [],
errorCounts: {},
};
}
//# sourceMappingURL=CompiledBot.js.map