Getting files structured

This commit is contained in:
Chris Bell 2025-07-16 13:07:12 -05:00
parent 42628581a9
commit d86c9db513
16 changed files with 96 additions and 10 deletions

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.File;
public interface ISzfFile
{
public string? Content { get; set; }
}

View File

@ -0,0 +1,8 @@
namespace SessionZero.SzfLib.File;
public class SzfFile : ISzfFile
{
public string? SzfType { get; set; }
public string? SchemaVersion { get; set; }
public string? Content { get; set; }
}

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.Generator;
public interface ISzfGenerator
{
}

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.Generator;
public class SzfGenerator : ISzfGenerator
{
}

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.Objects;
public interface ISzfCharacter
{
}

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.Objects;
public interface ISzfCharacterTemplate
{
}

View File

@ -0,0 +1,6 @@
namespace SessionZero.SzfLib.Objects;
public interface ISzfDataset
{
}

View File

@ -2,5 +2,5 @@ namespace SessionZero.SzfLib.Objects;
public interface ISzfObject
{
public string SzfType { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace SessionZero.SzfLib.Objects;
[SzfObject("character")]
public class SzfCharacter : SzfObject, ISzfCharacter
{
public override string SzfType { get; set; } = "character";
}

View File

@ -0,0 +1,7 @@
namespace SessionZero.SzfLib.Objects;
[SzfObject("character_template")]
public class SzfCharacterTemplate : SzfObject, ISzfCharacterTemplate
{
public override string SzfType { get; set; } = "character_template";
}

View File

@ -0,0 +1,7 @@
namespace SessionZero.SzfLib.Objects;
[SzfObject("dataset")]
public class SzfDataset : SzfObject, ISzfDataset
{
public override string SzfType { get; set; } = "dataset";
}

View File

@ -1,6 +1,6 @@
namespace SessionZero.SzfLib.Objects;
public class SzfObject : ISzfObject
public abstract class SzfObject : ISzfObject
{
public abstract string SzfType { get; set; }
}

View File

@ -0,0 +1,10 @@
using SessionZero.SzfLib.File;
using SessionZero.SzfLib.Objects;
namespace SessionZero.SzfLib.Parser;
public interface ISzfParser
{
public ISzfFile Parse(string szfContent);
public ISzfObject Parse(ISzfFile file);
}

View File

@ -0,0 +1,17 @@
using SessionZero.SzfLib.File;
using SessionZero.SzfLib.Objects;
namespace SessionZero.SzfLib.Parser;
public class SzfParser : ISzfParser
{
public ISzfFile Parse(string szfContent)
{
throw new NotImplementedException();
}
public ISzfObject Parse(ISzfFile file)
{
throw new NotImplementedException();
}
}

View File

@ -6,10 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="File\" />
<Folder Include="Generator\" />
<Folder Include="Parser\" />
</ItemGroup>
</Project>

View File

@ -7,7 +7,7 @@ public class SzfObjectAttribute : Attribute
/// The unique identifier for the SzfObject type (e.g., "dataset", "character_template", "character").
/// This is used in the `!tpye` header of the SZF file to identify the type of SzfObject.
/// </summary>
public required string TypeIdentifier { get; set; }
public string TypeIdentifier { get; set; }
public SzfObjectAttribute(string typeIdentifier)
{