feat: parse content text (base case).

This commit is contained in:
mattia
2025-02-16 18:26:28 +01:00
parent b7aae9a04f
commit d386c50499
32 changed files with 940 additions and 6 deletions

View File

@@ -7,4 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\InkBlot\InkBlot.csproj"/>
</ItemGroup>
</Project>

View File

@@ -1,3 +1,19 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
using System.Text;
using InkBlot;
var parser = new InkBlotParser();
parser.Parse(new PreMadeFileReader(new Dictionary<string, string>
{
{ "main.ink", "Hel-\\lo!" }
}), "main.ink");
internal class PreMadeFileReader(Dictionary<string, string> filesToContents) : IFileReader
{
public Stream GetContents(string filename)
{
return new MemoryStream(Encoding.UTF8.GetBytes(filesToContents[filename]));
}
}