修改静态资源文件夹位置

This commit is contained in:
Teo
2025-07-29 09:37:57 +08:00
parent ed996ee7f4
commit daff686afc
1465 changed files with 11 additions and 4 deletions

View File

@ -0,0 +1,62 @@
import { addNodeClass } from '../core/Node.js';
import TempNode from '../core/TempNode.js';
import { vectorComponents } from '../core/constants.js';
class SetNode extends TempNode {
constructor( sourceNode, components, targetNode ) {
super();
this.sourceNode = sourceNode;
this.components = components;
this.targetNode = targetNode;
}
getNodeType( builder ) {
return this.sourceNode.getNodeType( builder );
}
generate( builder ) {
const { sourceNode, components, targetNode } = this;
const sourceType = this.getNodeType( builder );
const targetType = builder.getTypeFromLength( components.length );
const targetSnippet = targetNode.build( builder, targetType );
const sourceSnippet = sourceNode.build( builder, sourceType );
const length = builder.getTypeLength( sourceType );
const snippetValues = [];
for ( let i = 0; i < length; i ++ ) {
const component = vectorComponents[ i ];
if ( component === components[ 0 ] ) {
snippetValues.push( targetSnippet );
i += components.length - 1;
} else {
snippetValues.push( sourceSnippet + '.' + component );
}
}
return `${ builder.getType( sourceType ) }( ${ snippetValues.join( ', ' ) } )`;
}
}
export default SetNode;
addNodeClass( 'SetNode', SetNode );