From d32ade642f1ccd8f589d8da8e678700b414816c0 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 18 May 2021 12:27:39 -0600 Subject: [PATCH] WIP nap --- projects/nap/src/nap/Archive.hx | 6 ++++++ projects/nap/src/nap/Archive.kiss | 11 +++++++++++ projects/nap/src/nap/Event.hx | 7 +++++++ projects/nap/src/nap/Lib.kiss | 0 projects/nap/src/nap/Main.kiss | 15 ++++++++++++++- projects/nap/src/nap/System.hx | 4 ++++ projects/nap/src/nap/System.kiss | 1 + projects/nap/src/nap/components/Tag.hx | 3 +++ projects/nap/src/nap/components/Tag.kiss | 0 9 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 projects/nap/src/nap/Archive.hx create mode 100644 projects/nap/src/nap/Archive.kiss create mode 100644 projects/nap/src/nap/Event.hx create mode 100644 projects/nap/src/nap/Lib.kiss create mode 100644 projects/nap/src/nap/System.hx create mode 100644 projects/nap/src/nap/System.kiss create mode 100644 projects/nap/src/nap/components/Tag.hx create mode 100644 projects/nap/src/nap/components/Tag.kiss diff --git a/projects/nap/src/nap/Archive.hx b/projects/nap/src/nap/Archive.hx new file mode 100644 index 00000000..1f3733a6 --- /dev/null +++ b/projects/nap/src/nap/Archive.hx @@ -0,0 +1,6 @@ +package nap; + +import sys.FileSystem; + +@:build(kiss.Kiss.build()) +class Archive {} \ No newline at end of file diff --git a/projects/nap/src/nap/Archive.kiss b/projects/nap/src/nap/Archive.kiss new file mode 100644 index 00000000..2384c67d --- /dev/null +++ b/projects/nap/src/nap/Archive.kiss @@ -0,0 +1,11 @@ +(defnew [archiveDir] + [:Map entries + (let [entryFiles (FileSystem.readDirectory archiveDir)] + (doFor )) + :Array systems []] // TODO also create systems + ) + +(defun loadFromDir [archiveDir] + ) + +(defmethod :Void handleEvent [:Event e]) \ No newline at end of file diff --git a/projects/nap/src/nap/Event.hx b/projects/nap/src/nap/Event.hx new file mode 100644 index 00000000..a984be72 --- /dev/null +++ b/projects/nap/src/nap/Event.hx @@ -0,0 +1,7 @@ +package nap; + +/** + * All types of user input events to the NAP system. Archive handles these, acting as a backend + * for whichever front-end generates the Events. + */ +enum Event {} \ No newline at end of file diff --git a/projects/nap/src/nap/Lib.kiss b/projects/nap/src/nap/Lib.kiss new file mode 100644 index 00000000..e69de29b diff --git a/projects/nap/src/nap/Main.kiss b/projects/nap/src/nap/Main.kiss index 8493c852..21d3b085 100644 --- a/projects/nap/src/nap/Main.kiss +++ b/projects/nap/src/nap/Main.kiss @@ -1,8 +1,21 @@ (defun :Void main [] + (let [archiveDir + // TODO pattern matching program arguments will be more complicated once --cache and other arguments are introduced + (ifLet [[dir] (Sys.args)] + dir + (Sys.getCwd)) + archive + (new Archive archiveDir)] + (archive.process))) + + + + /* (let [e (new Entry "name")] (dictSet e.components "f" [5]) (dictSet e.components "b" [(object c "d")]) (let [s (haxe.Json.stringify e) :Entry e2 (haxe.Json.parse s)] // can't call Entry methods on e2 - (print s)))) \ No newline at end of file + (print s)))) + */ \ No newline at end of file diff --git a/projects/nap/src/nap/System.hx b/projects/nap/src/nap/System.hx new file mode 100644 index 00000000..3fd66a51 --- /dev/null +++ b/projects/nap/src/nap/System.hx @@ -0,0 +1,4 @@ +package nap; + +@:build(kiss.Kiss.build()) +class System {} \ No newline at end of file diff --git a/projects/nap/src/nap/System.kiss b/projects/nap/src/nap/System.kiss new file mode 100644 index 00000000..55fbc0d1 --- /dev/null +++ b/projects/nap/src/nap/System.kiss @@ -0,0 +1 @@ +(defprop :List entries []) \ No newline at end of file diff --git a/projects/nap/src/nap/components/Tag.hx b/projects/nap/src/nap/components/Tag.hx new file mode 100644 index 00000000..dba2df82 --- /dev/null +++ b/projects/nap/src/nap/components/Tag.hx @@ -0,0 +1,3 @@ +package nap.components; + +typedef Tag = String; \ No newline at end of file diff --git a/projects/nap/src/nap/components/Tag.kiss b/projects/nap/src/nap/components/Tag.kiss new file mode 100644 index 00000000..e69de29b