* Removes the icon whose getType matches the given type iconType from the * block. * * @param type The type of the icon to remove from the block. * @returns True if an icon with the given type was found, false otherwise.
(type: IconType<IIcon>)
| 2422 | * @returns True if an icon with the given type was found, false otherwise. |
| 2423 | */ |
| 2424 | removeIcon(type: IconType<IIcon>): boolean { |
| 2425 | if (!this.hasIcon(type)) return false; |
| 2426 | this.getIcon(type)?.dispose(); |
| 2427 | this.icons = this.icons.filter((icon) => !icon.getType().equals(type)); |
| 2428 | return true; |
| 2429 | } |
| 2430 | |
| 2431 | /** |
| 2432 | * @returns True if an icon with the given type exists on the block, |