研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >Google Workspace >isCapacityAvailable
Workspace.isCapacityAvailable() 方法
检查要创建指定计数的块是否还有剩余容量。如果地图表示的区块总数超过剩余总容量,它会返回 false。如果某个类型计数超过了该类型的剩余容量,则返回 false。
Signature:
isCapacityAvailable(typeCountsMap: {
[key: string]: number;
}): boolean;
参数
参数 |
类型 |
说明 |
typeCountsMap |
{ [key: string]: number;} |
计数的类型映射(通常表示要创建的块)。 |
返回:
布尔值
如果指定地图具有可容纳性,则返回 true,否则返回 false。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-15。
[null,null,["最后更新时间 (UTC):2024-10-15。"],[[["The `isCapacityAvailable` method checks if a Blockly workspace has enough capacity to create new blocks based on the provided type and count."],["It returns `false` if the total number of blocks or the count of a specific block type exceeds the defined capacity, otherwise it returns `true`."],["The method uses a `typeCountsMap` parameter to specify the types and counts of blocks intended for creation."]]],[]]