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:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user