TheSadRogue.Primitives 1.6.0-rc1-debug

A collection of primitive data structures for working with a 2-dimensional grid.

Showing the top 20 packages that depend on TheSadRogue.Primitives.

Packages Downloads
GoRogue
Roguelike/2D game utility library.
22
GoRogue
Roguelike/2D game utility library.
24
GoRogue
Roguelike/2D game utility library.
25
GoRogue
Roguelike/2D game utility library.
26
GoRogue
Roguelike/2D game utility library.
27
GoRogue
Roguelike/2D game utility library.
28
GoRogue
Roguelike/2D game utility library.
29
GoRogue
Roguelike/2D game utility library.
30
GoRogue
Roguelike/2D game utility library.
31
GoRogue
Roguelike/2D game utility library.
32
GoRogue
Roguelike/2D game utility library.
34
GoRogue
Roguelike/2D game utility library.
35

- Added spatial maps, which are an efficient way to represent items on a grid, particularly when the items are sparse relative to the number of cells. - Added interfaces for common concepts found in data structures/objects that reside on 2D grids - IHasID: A structure that has a unique or pseudo-unique integer identifier - IHasLayer: A structure that has a z-index (aka layer) on which it resides - IPositionable: A structure that has a 2D position, and fires events when that position changes. - Added `LayerMasker` which is a helper class for creating 32-bit integer-based masks of specific z-indices/rendering layers. - Added more custom iterators, and changed iterator paradigm in library to allow for increased performance - Changes apply to classes/functions including: Rectangle.Positions(), Rectangle.PerimeterPositions(), all line and shape algorithms, LayerMasker functions, BisectionResult, and Area - Custom enumerables now implement `IEnumerator` and `IEnumerable` directly; therefore their `ToEnumerable()` function is obsolete. You should simply remove the call to that function since the same behavior is obtained without it. - This also applies to Area; FastEnumerator()` is now deprecated as its behavior is achieved by default when iterating over IReadOnlyArea implementations. - Iteration over a value known to be of type `Area` is now faster - Added a ListEnumerator type which is functionally identical to C#'s built-in enumerator for lists, but also implements IEnumerable so supports being returned from functions like the primitives library typically does for functions such as Rectangle.Positions() - Added `Box` shape algorithm - Modified default hashing algorithm for Point to one with better performance - New hashing algorithm collides less and remains viable over a very large range of points; see Point.GetHashCode() documentation for details - Optimized spatial maps compared to the GoRogue implementation - The result of MultiSpatialMap.GetItemsAt is now significantly faster to iterate over if the value is of known type MultiSpatialMap - Added auto-syncing variants of spatial maps - Anything implementing IPositionable can be used with the auto-syncing variants - With these variants, if you change the Position field of an object within the spatial map, OR if you call a movement function on the spatial map, both the spatial map and the Position field update and remain in sync - Modified SpatialMap API slightly - Move functions (and variants) now tolerate the current position and target position being the same without failing - Fixed bugs in LayeredSpatialMap - LayeredSpatialMap.TryMoveAll guarantees that objects aren't moved at all if one or more can't be moved - LayeredSpatialMap.GetLayersInMask now returns the correct layers

.NET Core 3.1

  • No dependencies.

.NET 5.0

  • No dependencies.

.NET 6.0

  • No dependencies.

.NET 7.0

  • No dependencies.

.NET Standard 2.1

  • No dependencies.

Version Downloads Last updated
1.6.0 3 06/08/2025
1.6.0-rc3-debug 27 02/06/2024
1.6.0-rc3 27 02/06/2024
1.6.0-rc2-debug 30 02/10/2024
1.6.0-rc2 32 02/06/2024
1.6.0-rc1-debug 37 02/10/2024
1.6.0-rc1 21 02/06/2024
1.6.0-debug 3 06/09/2025
1.5.1 25 02/06/2024
1.5.1-debug 30 02/06/2024
1.5.0 40 02/06/2024
1.5.0-debug 24 02/06/2024
1.4.1 28 02/06/2024
1.4.1-debug 28 02/06/2024
1.4.0 39 02/06/2024
1.4.0-debug 29 02/06/2024
1.3.2 24 02/06/2024
1.3.2-debug 26 02/06/2024
1.3.1 26 02/06/2024
1.3.1-debug 21 02/06/2024
1.3.0 21 02/06/2024
1.3.0-debug 28 02/06/2024
1.2.0 30 02/06/2024
1.2.0-debug 28 02/06/2024
1.1.1 28 02/06/2024
1.1.1-debug 29 02/06/2024
1.1.0 27 02/06/2024
1.1.0-debug 20 02/06/2024
1.0.0 29 02/06/2024
1.0.0-debug 26 02/06/2024
1.0.0-alpha9-debug 34 02/06/2024
1.0.0-alpha9 26 02/06/2024
1.0.0-alpha8-debug 33 02/06/2024
1.0.0-alpha8 27 02/06/2024
1.0.0-alpha7-debug 29 02/06/2024
1.0.0-alpha7 28 02/06/2024
1.0.0-alpha6-debug 36 02/06/2024
1.0.0-alpha6 40 02/06/2024
1.0.0-alpha5-debug 31 02/06/2024
1.0.0-alpha5 35 02/06/2024
1.0.0-alpha4-debug 32 02/06/2024
1.0.0-alpha4 38 02/06/2024
1.0.0-alpha3-debug 31 02/06/2024
1.0.0-alpha3 30 02/06/2024
1.0.0-alpha2-debug 34 02/06/2024
1.0.0-alpha2 30 02/06/2024
1.0.0-alpha1-debug 27 02/06/2024
1.0.0-alpha1 25 02/06/2024