DopeGrid 1.2.2

dotnet add package DopeGrid --version 1.2.2
                    
NuGet\Install-Package DopeGrid -Version 1.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DopeGrid" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DopeGrid" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="DopeGrid" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DopeGrid --version 1.2.2
                    
#r "nuget: DopeGrid, 1.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DopeGrid@1.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DopeGrid&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=DopeGrid&version=1.2.2
                    
Install as a Cake Tool

Dope Grid

Dope Grid is a high-performance, memory-efficient library for creating and managing 2D grids in Unity. It's designed for scenarios where you need to work with many grids or perform frequent grid operations, such as in inventory systems, board games, or procedural generation.

Overview

Dope Grid provides a set of tools for working with 2D grids of different types. It's built with performance in mind, using structs, ArrayPool, and other techniques to minimize garbage collection and maximize speed. The library is highly extensible, allowing you to create custom grid types and operations.

Features

  • High-performance: Designed for speed and memory efficiency.
  • Multiple Grid Types: Includes GridShape, ValueGridShape, FixedGridShape, and ImmutableGridShape for different use cases.
  • Rich API: Provides a wide range of operations for manipulating grids, such as rotation, flipping, and finding the best fit for a shape.
  • Extensible: Easily create custom grid types and operations.

Core Concepts

GridShape

GridShape is a mutable grid of booleans. It's useful for representing the shape of an item or a container.

ImmutableGridShape

ImmutableGridShape is an immutable version of GridShape. It's designed for scenarios where you need to share shapes between multiple grids without the risk of accidental modification.

ValueGridShape<T>

ValueGridShape<T> is a generic grid that can store any unmanaged type. It's useful for storing data associated with each cell in a grid, such as item IDs or tile types.

FixedGridShape<TSize>

FixedGridShape<TSize> is a grid with a fixed size known at compile time. It's useful for small grids where you want to avoid heap allocations.

Usage

Here's a simple example of how to use Dope Grid to create a grid and add an item to it:

using DopeGrid;
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Create a 10x10 grid
        var grid = new GridBoard(10, 10);

        // Create a 2x2 square shape
        var itemShape = Shapes.ImmutableSquare(2);

        // Try to add the item to the grid
        if (grid.TryAddItem(itemShape))
        {
            Debug.Log("Item added successfully!");
        }
        else
        {
            Debug.Log("Failed to add item.");
        }

        // Dispose the grid when you're done with it
        grid.Dispose();
    }
}

API Documentation

For a detailed overview of the API, please refer to the source code and the inline documentation.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository.

License

Dope Grid is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.2 165 10/10/2025
1.2.1 145 10/10/2025
1.2.0 148 10/10/2025
1.1.0 162 10/8/2025
1.0.0 162 10/7/2025