Cubusky.Core 1.0.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Cubusky.Core --version 1.0.2
                    
NuGet\Install-Package Cubusky.Core -Version 1.0.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="Cubusky.Core" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cubusky.Core" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Cubusky.Core" />
                    
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 Cubusky.Core --version 1.0.2
                    
#r "nuget: Cubusky.Core, 1.0.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 Cubusky.Core@1.0.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=Cubusky.Core&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Cubusky.Core&version=1.0.2
                    
Install as a Cake Tool

Icon

Cubusky

Cubusky is a .NET Core library that provides a set of tools and utilities to help you build your applications faster and easier. It is a collection of classes, methods, and extensions focussing on optimized data storage, easy-to-use save and load functionality, and developer customization.

Target towards but not limited to game development, Cubusky is designed to be lightweight, easy to use, and highly customizable. All public code is documented and tested, and the library is designed to be as user-friendly as possible. Benchmarks are also included to help you understand the performance of the library.

The whole project is open-source and free to use, and you are welcome to contribute to the project.

Installing / Getting started

The project can be installed from NuGet using either the NuGet Package Manager in Visual Studio or the NuGet CLI in the command line, e.g.

nuget install Cubusky.Core

The package and all of its dependencies will automatically be installed.

Features

  • Save and Load: Cubusky provides easy-to-use save and load functionality that can be customized to fit your needs.
public class SaverLoader
{
    public IIOStreamProvider IO = new FileIO("C://myFile.json");
    public IStreamSerializer Serializer = new JsonSerializer();
    public ICompressionStreamProvider Compression = new GZipCompression();

    public void Save<T>(T value)
    {
        IO.Save(Serializer, Compression, value);
    }

    public T? Load<T>()
    {
        return IO.Load<T>(Serializer, Compression);
    }
}
  • Optimized Heatmaps: Cubusky provides a set of optimized data structures and algorithms to help you build heatmaps faster and easier.
public class Player
{
    public SaverLoader saverLoader;
    public Heatmap3to2 heatmap;

    public void Awake()
    {
        heatmap = saverLoader.Load<Heatmap3to2>() ?? new();
    }

    public void Update()
    {
        heatmap.Add(Position);
    }

    public void OnDestroy()
    {
        saverLoader.Save(heatmap);
    }
}
  • Optimized Json Converters Optimized Json Converters for common numerics often used in game development.
public class JsonData
{
    [JsonConverter(typeof(Vector3JsonConverter))]
    public Vector3 Position { get; set; } // Will be serialized as [X,Y,Z]

    [JsonConverter(typeof(QuaternionJsonConverter))]
    public Quaternion Rotation { get; set; } // Will be serialized as [X,Y,Z,W]

    [JsonConverter(typeof(Matrix4x4JsonConverter))]
    public Matrix4x4 Transform { get; set; } // Will be serialized as [M11,M12,M13,M14,M21,M22,M23,M24,M31,M32,M33,M34,M41,M42,M43,M44]
}
  • Many to Many Observer Pattern: Cubusky provides a many-to-many observer pattern that allows you to easily observe and notify multiple objects.
// Observe as many players from as many heatmaps as you want.

public static class ObserverSets
{
    public static readonly ObserverSet<Vector3> Vector3 = new();
}

public class Heatmap : IObserver<Vector3>
{
    public void OnEnable() => ObserverSets.Vector3.Add(this);
    public void OnDisable() => ObserverSets.Vector3.Remove(this);
}

public class Player : IObservable<Vector3>
{
    public void OnEnable() => ObserverSets.Vector3.Add(this);
    public void OnDisable() => ObserverSets.Vector3.Remove(this);
}

Contributing

You can contribute to Cubusky with issues and PRs. Simply filing issues for problems you encounter is a great way to contribute. Contributing implementations is greatly appreciated.

TODO: format a contributing guide in a CONTRIBUTING.md file. For now, follow the dotnet contribution guide and the dotnet coding style.

Licensing

The code in this project is licensed under GNU GPLv3. This license lets users do almost anything they want with the project, except distributing closed sourced versions. Ansible, Bash and GIMP use the GNU GPLv3. For more information, see the LICENSE file.

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 is compatible.  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.0.3-beta 275 8/6/2025
1.0.2 151 7/29/2025
1.0.1 251 4/15/2025
1.0.0 177 9/28/2024