Tries to get box with given ID. The box id. Box or null if cannot find.
(int id)
| 552 | /// <param name="id">The box id.</param> |
| 553 | /// <returns>Box or null if cannot find.</returns> |
| 554 | public Box GetBox(int id) |
| 555 | { |
| 556 | // TODO: maybe create local cache for boxes? but not a dictionary, use lookup table because ids are usually small (less than 20) |
| 557 | for (int i = 0; i < Elements.Count; i++) |
| 558 | { |
| 559 | if (Elements[i] is Box box && box.ID == id) |
| 560 | return box; |
| 561 | } |
| 562 | return null; |
| 563 | } |
| 564 | |
| 565 | /// <summary> |
| 566 | /// Tries to get box with given ID. |
no outgoing calls
no test coverage detected