Node.js 491 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. class Node {
  2. constructor( type = null ) {
  3. this.type = type;
  4. this.needsUpdate = false;
  5. Object.defineProperty( this, 'isNode', { value: true } );
  6. }
  7. getType( /*builder*/ ) {
  8. return this.type;
  9. }
  10. update( /*frame*/ ) {
  11. console.warn( "Abstract function." );
  12. }
  13. generate( /*builder, output*/ ) {
  14. console.warn( "Abstract function." );
  15. }
  16. build( builder, output ) {
  17. builder.addNode( this );
  18. return this.generate( builder, output );
  19. }
  20. }
  21. export default Node;