Data Structures

The Architecture Toolkit contains various data structures that may be useful throughout a project. The following data structures are available in the package:

🎲 Accumulators

Accumulators work like a reducer function by accumulating a set of values into a single total value except you can store the values using identifiers. This is useful to accumulate values over time while adding and removing values as needed. The total value is updated automatically any time a value is added or removed.

Supported types:

🎚️ Ranges

Ranges allow you to specify a lower and upper bound which can then be used for a multitude of purposes including clamping values, interpolating numbers, generating random values, and more.

Included types:

💾 Misc

  • Bitmask - A bitmask representation that can be used for bitwise operations.
  • Bool3 - Stores a tuple of 3 booleans
  • GridSize - Stores the size of a grid as rows and columns.
  • Quantity<T> - Stores a quantity of a given entity type
  • Registry<T> - Manages a list of unique items and invokes callbacks when an item is added or removed from the list.
  • RuntimeSet<T> - A ScriptableObject that stores a list of items. A project asset can be created for the runtime set so it can be referenced throughout the application, but the items are added and removed at runtime.
  • Size - Stores the size of an entity as a width and height