Add HSchool.Content project for JSONC definitions, catalog, and map validation. Update solution structure to include new content and tests projects. Enhance school management to support mod packs and map instances, ensuring proper loading and validation. Revise documentation to reflect these changes and update tests for new functionality.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
namespace HSchool.Content;
|
||||
|
||||
public enum DefKind
|
||||
{
|
||||
Action,
|
||||
Thing,
|
||||
Position,
|
||||
Work,
|
||||
Room,
|
||||
Building,
|
||||
Floor,
|
||||
Territory,
|
||||
}
|
||||
|
||||
/// <summary>Shared JSONC fields. Kind comes from the folder under <c>defs/</c>, not from the file.</summary>
|
||||
public abstract class Def
|
||||
{
|
||||
public required string DefName { get; init; }
|
||||
|
||||
public string? Parent { get; init; }
|
||||
|
||||
public bool Abstract { get; init; }
|
||||
}
|
||||
|
||||
public sealed class ActionDef : Def;
|
||||
|
||||
public sealed class ThingDef : Def
|
||||
{
|
||||
public IReadOnlyList<string> Actions { get; init; } = [];
|
||||
}
|
||||
|
||||
public sealed class PositionDef : Def;
|
||||
|
||||
public sealed class WorkDef : Def;
|
||||
|
||||
public sealed class RoomSlot
|
||||
{
|
||||
public required string Key { get; init; }
|
||||
|
||||
public required string Thing { get; init; }
|
||||
|
||||
public int Count { get; init; } = 1;
|
||||
}
|
||||
|
||||
public sealed class RoomDef : Def
|
||||
{
|
||||
public IReadOnlyList<RoomSlot> Slots { get; init; } = [];
|
||||
|
||||
public IReadOnlyList<string> Positions { get; init; } = [];
|
||||
|
||||
public IReadOnlyList<string> Works { get; init; } = [];
|
||||
}
|
||||
|
||||
public sealed class BuildingDef : Def;
|
||||
|
||||
public sealed class FloorDef : Def;
|
||||
|
||||
public sealed class TerritoryDef : Def;
|
||||
Reference in New Issue
Block a user