@@ -50,6 +50,7 @@ export function newPickingUpItem(): PickingUpItem {
50
50
} ;
51
51
}
52
52
53
+ /** Helper function to reset a `PickupUpItem` object to all 0 values. */
53
54
export function resetPickingUpItem ( pickingUpItem : PickingUpItem ) : void {
54
55
pickingUpItem . itemType = DEFAULT_ITEM_TYPE ;
55
56
pickingUpItem . subType = DEFAULT_SUB_TYPE ;
@@ -61,21 +62,27 @@ const COLLECTIBLE_ITEM_TYPES = new ReadonlySet<ItemType>([
61
62
ItemType . FAMILIAR , // 4
62
63
] ) ;
63
64
64
- /** Helper function to narrow the type of `PickingUpItem`. */
65
+ /** Helper function to narrow the type of `PickingUpItem` to `ItemType.NULL` (0) . */
65
66
export function isPickingUpItemNull (
66
67
pickingUpItem : PickingUpItem ,
67
68
) : pickingUpItem is PickingUpItemTrinket {
68
69
return pickingUpItem . itemType === ItemType . NULL ;
69
70
}
70
71
71
- /** Helper function to narrow the type of `PickingUpItem`. */
72
+ /**
73
+ * Helper function to narrow the type of `PickingUpItem` to one of the following:
74
+ *
75
+ * - `ItemType.PASSIVE` (1)
76
+ * - `ItemType.ACTIVE` (3)
77
+ * - `ItemType.FAMILIAR` (4)
78
+ */
72
79
export function isPickingUpItemCollectible (
73
80
pickingUpItem : PickingUpItem ,
74
81
) : pickingUpItem is PickingUpItemCollectible {
75
82
return COLLECTIBLE_ITEM_TYPES . has ( pickingUpItem . itemType ) ;
76
83
}
77
84
78
- /** Helper function to narrow the type of `PickingUpItem`. */
85
+ /** Helper function to narrow the type of `PickingUpItem` to `ItemType.TRINKET` (2) . */
79
86
export function isPickingUpItemTrinket (
80
87
pickingUpItem : PickingUpItem ,
81
88
) : pickingUpItem is PickingUpItemTrinket {
0 commit comments