Procházet zdrojové kódy

Add comments to FindObjectByID

ApisNecros před 1 rokem
rodič
revize
3e00fed52c
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      5/5_1.ts

+ 7 - 0
5/5_1.ts

@@ -131,6 +131,13 @@ function ParseSourceDestinationRange(lineNumber: number, almanac: string[]): Map
     return rangeMap;
 }
 
+/**
+ * Find an IdentifiableObject by its ID number
+ *
+ * @param needle The ID number to find
+ * @param haystack The list to find the ID in
+ * @returns {IdentifiableObject|undefined} The object by that ID if found, or undefined
+ */
 function FindObjectByID(needle: number, haystack: IdentifiableObject[]): IdentifiableObject|undefined {
     return haystack.find((obj) => obj.ID == needle);
 }