feat: condition
This commit is contained in:
parent
bfeeb6c318
commit
9b87f9ea74
|
@ -203,6 +203,23 @@ const Expression = ({
|
|||
if ('any' === arg.type) {
|
||||
return {type: 'undefined'};
|
||||
}
|
||||
if ('condition' === arg.type) {
|
||||
return {
|
||||
...(false === arg.compile ? {compile: false} : {}),
|
||||
type: 'condition',
|
||||
operator: 'and',
|
||||
operands: [
|
||||
{
|
||||
type: 'literal',
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
type: 'literal',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
if ('expressions' === arg.type) {
|
||||
return {
|
||||
type: 'expressions',
|
||||
|
|
|
@ -2,6 +2,7 @@ import {basename, extname} from 'path';
|
|||
|
||||
import {camelCase} from '@latus/core';
|
||||
|
||||
import Condition from './behavior-components/condition';
|
||||
import Expression from './behavior-components/expression';
|
||||
import Expressions from './behavior-components/expressions';
|
||||
import Literal from './behavior-components/literal';
|
||||
|
@ -21,6 +22,7 @@ export default {
|
|||
const TraitRenderers = latus.invokeReduce('@persea/entity/trait-components');
|
||||
latus.set('%trait-components', TraitRenderers);
|
||||
latus.set('%behavior-controllers', {
|
||||
condition: Condition,
|
||||
expression: Expression,
|
||||
expressions: Expressions,
|
||||
literal: Literal,
|
||||
|
|
Loading…
Reference in New Issue
Block a user