From 42628581a952514fef1f9e6a303502b2d60bbe1f Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Tue, 15 Jul 2025 20:29:24 -0500 Subject: [PATCH] Init --- .gitignore | 7 +++++ SessionZero.SzfCli/Program.cs | 29 ++++++++++++++++++++ SessionZero.SzfCli/SessionZero.SzfCli.csproj | 19 +++++++++++++ SessionZero.SzfLib/Objects/ISzfObject.cs | 6 ++++ SessionZero.SzfLib/Objects/SzfObject.cs | 6 ++++ SessionZero.SzfLib/SessionZero.SzfLib.csproj | 15 ++++++++++ SessionZero.SzfLib/SzfObjectAttribute.cs | 21 ++++++++++++++ SessionZero.SzfToolkit.sln | 22 +++++++++++++++ 8 files changed, 125 insertions(+) create mode 100644 .gitignore create mode 100644 SessionZero.SzfCli/Program.cs create mode 100644 SessionZero.SzfCli/SessionZero.SzfCli.csproj create mode 100644 SessionZero.SzfLib/Objects/ISzfObject.cs create mode 100644 SessionZero.SzfLib/Objects/SzfObject.cs create mode 100644 SessionZero.SzfLib/SessionZero.SzfLib.csproj create mode 100644 SessionZero.SzfLib/SzfObjectAttribute.cs create mode 100644 SessionZero.SzfToolkit.sln diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..874ae51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.idea + +SessionZero.SzfCli/bin +SessionZero.SzfCli/obj + +SessionZero.SzfLib/bin +SessionZero.SzfLib/obj \ No newline at end of file diff --git a/SessionZero.SzfCli/Program.cs b/SessionZero.SzfCli/Program.cs new file mode 100644 index 0000000..eecb11b --- /dev/null +++ b/SessionZero.SzfCli/Program.cs @@ -0,0 +1,29 @@ +// See https://aka.ms/new-console-template for more information + +using Spectre.Console; + +AnsiConsole.MarkupLine("[deepskyblue4_1]\n\n" + + " █████████ ███████████ ███████████ █████████ █████ █████\n" + + " ███░░░░░███░█░░░░░░███ ░░███░░░░░░█ ███░░░░░███░░███ ░░███ \n" + + "░███ ░░░ ░ ███░ ░███ █ ░ ███ ░░░ ░███ ░███ \n" + + "░░█████████ ███ ░███████ ░███ ░███ ░███ \n" + + " ░░░░░░░░███ ███ ░███░░░█ ░███ ░███ ░███ \n" + + " ███ ░███ ████ █ ░███ ░ ░░███ ███ ░███ █ ░███ \n" + + "░░█████████ ███████████ █████ ░░█████████ ███████████ █████\n" + + " ░░░░░░░░░ ░░░░░░░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░░░░░░░ ░░░░░ \n\n[/]" + ); + + +AnsiConsole.MarkupLine("[deepskyblue4_2]A tool for testing the SessionZero SZF Parser[/]"); +AnsiConsole.MarkupLine("See [blue][link]https://sessionzero.app/szf-docs.html[/][/] for SZF documentation."); + +struct SZColors +{ + public static readonly Color BackgroundColor = Color.Grey19; + public static readonly Color PrimaryColor = Color.SteelBlue; + public static readonly Color PrimaryColorLight = Color.SlateBlue1; + public static readonly Color SecondaryColor = Color.NavyBlue; + public static readonly Color AccentColor = Color.DeepSkyBlue4_2; + public static readonly Color TextColor = Color.White; + public static readonly Color HeadingColor = Color.LightSteelBlue; +} \ No newline at end of file diff --git a/SessionZero.SzfCli/SessionZero.SzfCli.csproj b/SessionZero.SzfCli/SessionZero.SzfCli.csproj new file mode 100644 index 0000000..1a67ca5 --- /dev/null +++ b/SessionZero.SzfCli/SessionZero.SzfCli.csproj @@ -0,0 +1,19 @@ + + + + Exe + net9.0 + enable + enable + + + + + + + + + + + + diff --git a/SessionZero.SzfLib/Objects/ISzfObject.cs b/SessionZero.SzfLib/Objects/ISzfObject.cs new file mode 100644 index 0000000..8ed9db5 --- /dev/null +++ b/SessionZero.SzfLib/Objects/ISzfObject.cs @@ -0,0 +1,6 @@ +namespace SessionZero.SzfLib.Objects; + +public interface ISzfObject +{ + +} \ No newline at end of file diff --git a/SessionZero.SzfLib/Objects/SzfObject.cs b/SessionZero.SzfLib/Objects/SzfObject.cs new file mode 100644 index 0000000..0e0071d --- /dev/null +++ b/SessionZero.SzfLib/Objects/SzfObject.cs @@ -0,0 +1,6 @@ +namespace SessionZero.SzfLib.Objects; + +public class SzfObject : ISzfObject +{ + +} \ No newline at end of file diff --git a/SessionZero.SzfLib/SessionZero.SzfLib.csproj b/SessionZero.SzfLib/SessionZero.SzfLib.csproj new file mode 100644 index 0000000..059b212 --- /dev/null +++ b/SessionZero.SzfLib/SessionZero.SzfLib.csproj @@ -0,0 +1,15 @@ + + + + net9.0 + enable + enable + + + + + + + + + diff --git a/SessionZero.SzfLib/SzfObjectAttribute.cs b/SessionZero.SzfLib/SzfObjectAttribute.cs new file mode 100644 index 0000000..0569238 --- /dev/null +++ b/SessionZero.SzfLib/SzfObjectAttribute.cs @@ -0,0 +1,21 @@ +namespace SessionZero.SzfLib; + +[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] +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. + /// + public required string TypeIdentifier { get; set; } + + public SzfObjectAttribute(string typeIdentifier) + { + if (string.IsNullOrWhiteSpace(typeIdentifier)) + { + throw new ArgumentException("Type identifier cannot be null or whitespace.", nameof(typeIdentifier)); + } + + TypeIdentifier = typeIdentifier; + } +} \ No newline at end of file diff --git a/SessionZero.SzfToolkit.sln b/SessionZero.SzfToolkit.sln new file mode 100644 index 0000000..db1c95b --- /dev/null +++ b/SessionZero.SzfToolkit.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SessionZero.SzfLib", "SessionZero.SzfLib\SessionZero.SzfLib.csproj", "{5BBC117D-F751-41AE-BA6D-4F99A9D2459D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SessionZero.SzfCli", "SessionZero.SzfCli\SessionZero.SzfCli.csproj", "{8540219D-5605-4E8A-83A5-7E38245458A5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5BBC117D-F751-41AE-BA6D-4F99A9D2459D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BBC117D-F751-41AE-BA6D-4F99A9D2459D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BBC117D-F751-41AE-BA6D-4F99A9D2459D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BBC117D-F751-41AE-BA6D-4F99A9D2459D}.Release|Any CPU.Build.0 = Release|Any CPU + {8540219D-5605-4E8A-83A5-7E38245458A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8540219D-5605-4E8A-83A5-7E38245458A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8540219D-5605-4E8A-83A5-7E38245458A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8540219D-5605-4E8A-83A5-7E38245458A5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal