diff --git a/Command.cs b/src/Command.cs similarity index 92% rename from Command.cs rename to src/Command.cs index 3b015c5..e90c171 100644 --- a/Command.cs +++ b/src/Command.cs @@ -25,7 +25,9 @@ namespace Dungeoneer { Console.WriteLine($"{roll.Print}\n => {result}"); } - + public static void New(IList args) { + + } } diff --git a/Format.cs b/src/Format.cs similarity index 100% rename from Format.cs rename to src/Format.cs diff --git a/Lexer.cs b/src/Lexer.cs similarity index 89% rename from Lexer.cs rename to src/Lexer.cs index ba96057..c57a38c 100644 --- a/Lexer.cs +++ b/src/Lexer.cs @@ -52,6 +52,14 @@ namespace Dungeoneer.Lexing { Count = int.Parse(match.Groups[1].Value); Sides = int.Parse(match.Groups[2].Value); } + public DiceToken(string text) { + var match = Match(text); + if(match.Success) { + Count = int.Parse(match.Groups[1].Value); + Sides = int.Parse(match.Groups[2].Value); + } else + throw new Exception("fuck you"); + } private const string Style = "\x1b[34;1m"; private static readonly Regex Pattern = new Regex(@"(\d+)d(\d+)"); diff --git a/Object.cs b/src/Object.cs similarity index 100% rename from Object.cs rename to src/Object.cs diff --git a/Program.cs b/src/Program.cs similarity index 91% rename from Program.cs rename to src/Program.cs index 2ffbd75..d4f22c2 100644 --- a/Program.cs +++ b/src/Program.cs @@ -19,6 +19,7 @@ namespace Dungeoneer { public static void Main() { Console.WriteLine("Starting"); + Scripting.Run("roll.py"); Scripting.Run("repl.py"); } diff --git a/Roll.cs b/src/Roll.cs similarity index 100% rename from Roll.cs rename to src/Roll.cs diff --git a/Scripting.cs b/src/Scripting.cs similarity index 95% rename from Scripting.cs rename to src/Scripting.cs index 7ef7a88..846b605 100644 --- a/Scripting.cs +++ b/src/Scripting.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using System.Reflection; + using IronPython.Hosting; using Microsoft.Scripting.Hosting; @@ -14,6 +16,7 @@ namespace Dungeoneer { Scope = Engine.CreateScope(); dynamic builtin = Engine.GetBuiltinModule(); + // set up imports var paths = Engine.GetSearchPaths(); paths.Add("/usr/lib/python3.12/"); Engine.SetSearchPaths(paths); diff --git a/Util.cs b/src/Util.cs similarity index 100% rename from Util.cs rename to src/Util.cs