Remove obsolete project files for MrGameEng.AI, MrGameEng.Assets, MrGameEng.Atlases, and MrGameEng.Collisions modules. Introduce new AssetManager and related classes for asset loading and management, including support for texture atlases and mod definitions. Enhance mod loading capabilities with DefDatabase and LanguageManager for JSON-based definitions and localization. Implement a shelf packing algorithm for efficient texture atlas creation.

This commit is contained in:
Leonid Pershin
2026-06-12 07:47:04 +03:00
parent 1f87fb0b74
commit c30e2ce764
70 changed files with 0 additions and 233 deletions
+29
View File
@@ -0,0 +1,29 @@
namespace MrGameEng.Mods;
/// <summary>One discovered mod: its metadata and content directories on disk.</summary>
public sealed class Mod
{
internal Mod(ModInfo info, string rootPath)
{
Info = info;
RootPath = rootPath;
}
/// <summary>Metadata from <c>About/About.json</c>.</summary>
public ModInfo Info { get; }
/// <summary>Absolute path of the mod's root directory.</summary>
public string RootPath { get; }
/// <summary>Unique mod id (shortcut for <c>Info.Id</c>).</summary>
public string Id => Info.Id;
/// <summary>
/// Absolute path of a content folder inside the mod (e.g. <c>Defs</c>, <c>Textures</c>,
/// <c>Languages</c>). The folder is not required to exist.
/// </summary>
public string ContentPath(string folder) => Path.Combine(RootPath, folder);
/// <inheritdoc />
public override string ToString() => $"{Id} {Info.Version}".TrimEnd();
}