Getting files structured
This commit is contained in:
parent
42628581a9
commit
d86c9db513
6
SessionZero.SzfLib/File/ISzfFile.cs
Normal file
6
SessionZero.SzfLib/File/ISzfFile.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.File;
|
||||||
|
|
||||||
|
public interface ISzfFile
|
||||||
|
{
|
||||||
|
public string? Content { get; set; }
|
||||||
|
}
|
8
SessionZero.SzfLib/File/SzfFile.cs
Normal file
8
SessionZero.SzfLib/File/SzfFile.cs
Normal 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; }
|
||||||
|
}
|
6
SessionZero.SzfLib/Generator/ISzfGenerator.cs
Normal file
6
SessionZero.SzfLib/Generator/ISzfGenerator.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.Generator;
|
||||||
|
|
||||||
|
public interface ISzfGenerator
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
6
SessionZero.SzfLib/Generator/SzfGenerator.cs
Normal file
6
SessionZero.SzfLib/Generator/SzfGenerator.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.Generator;
|
||||||
|
|
||||||
|
public class SzfGenerator : ISzfGenerator
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
6
SessionZero.SzfLib/Objects/ISzfCharacter.cs
Normal file
6
SessionZero.SzfLib/Objects/ISzfCharacter.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
|
public interface ISzfCharacter
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
6
SessionZero.SzfLib/Objects/ISzfCharacterTemplate.cs
Normal file
6
SessionZero.SzfLib/Objects/ISzfCharacterTemplate.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
|
public interface ISzfCharacterTemplate
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
6
SessionZero.SzfLib/Objects/ISzfDataset.cs
Normal file
6
SessionZero.SzfLib/Objects/ISzfDataset.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
|
public interface ISzfDataset
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -2,5 +2,5 @@ namespace SessionZero.SzfLib.Objects;
|
|||||||
|
|
||||||
public interface ISzfObject
|
public interface ISzfObject
|
||||||
{
|
{
|
||||||
|
public string SzfType { get; set; }
|
||||||
}
|
}
|
7
SessionZero.SzfLib/Objects/SzfCharacter.cs
Normal file
7
SessionZero.SzfLib/Objects/SzfCharacter.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
|
[SzfObject("character")]
|
||||||
|
public class SzfCharacter : SzfObject, ISzfCharacter
|
||||||
|
{
|
||||||
|
public override string SzfType { get; set; } = "character";
|
||||||
|
}
|
7
SessionZero.SzfLib/Objects/SzfCharacterTemplate.cs
Normal file
7
SessionZero.SzfLib/Objects/SzfCharacterTemplate.cs
Normal 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";
|
||||||
|
}
|
7
SessionZero.SzfLib/Objects/SzfDataset.cs
Normal file
7
SessionZero.SzfLib/Objects/SzfDataset.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
|
[SzfObject("dataset")]
|
||||||
|
public class SzfDataset : SzfObject, ISzfDataset
|
||||||
|
{
|
||||||
|
public override string SzfType { get; set; } = "dataset";
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
namespace SessionZero.SzfLib.Objects;
|
namespace SessionZero.SzfLib.Objects;
|
||||||
|
|
||||||
public class SzfObject : ISzfObject
|
public abstract class SzfObject : ISzfObject
|
||||||
{
|
{
|
||||||
|
public abstract string SzfType { get; set; }
|
||||||
}
|
}
|
10
SessionZero.SzfLib/Parser/ISzfParser.cs
Normal file
10
SessionZero.SzfLib/Parser/ISzfParser.cs
Normal 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);
|
||||||
|
}
|
17
SessionZero.SzfLib/Parser/SzfParser.cs
Normal file
17
SessionZero.SzfLib/Parser/SzfParser.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
@ -6,10 +6,4 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="File\" />
|
|
||||||
<Folder Include="Generator\" />
|
|
||||||
<Folder Include="Parser\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -7,7 +7,7 @@ public class SzfObjectAttribute : Attribute
|
|||||||
/// The unique identifier for the SzfObject type (e.g., "dataset", "character_template", "character").
|
/// 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.
|
/// This is used in the `!tpye` header of the SZF file to identify the type of SzfObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required string TypeIdentifier { get; set; }
|
public string TypeIdentifier { get; set; }
|
||||||
|
|
||||||
public SzfObjectAttribute(string typeIdentifier)
|
public SzfObjectAttribute(string typeIdentifier)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user