Просмотр исходного кода

`StorageBufferNode`: Add `getMemberType` (#31139)

Hongcheng Zhao 8 месяцев назад
Родитель
Сommit
6c8e82800f
1 измененных файлов с 19 добавлено и 0 удалено
  1. 19 0
      src/nodes/accessors/StorageBufferNode.js

+ 19 - 0
src/nodes/accessors/StorageBufferNode.js

@@ -335,6 +335,25 @@ class StorageBufferNode extends BufferNode {
 
 	}
 
+	/**
+	 * Returns the type of a member of the struct.
+	 *
+	 * @param {NodeBuilder} builder - The current node builder.
+	 * @param {string} name - The name of the member.
+	 * @return {string} The type of the member.
+	 */
+	getMemberType( builder, name ) {
+
+		if ( this.structTypeNode !== null ) {
+
+			return this.structTypeNode.getMemberType( builder, name );
+
+		}
+
+		return 'void';
+
+	}
+
 	/**
 	 * Generates the code snippet of the storage buffer node.
 	 *

粤ICP备19079148号