WIP nap
This commit is contained in:
6
projects/nap/src/nap/Archive.hx
Normal file
6
projects/nap/src/nap/Archive.hx
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package nap;
|
||||||
|
|
||||||
|
import sys.FileSystem;
|
||||||
|
|
||||||
|
@:build(kiss.Kiss.build())
|
||||||
|
class Archive {}
|
11
projects/nap/src/nap/Archive.kiss
Normal file
11
projects/nap/src/nap/Archive.kiss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
(defnew [archiveDir]
|
||||||
|
[:Map<String,Entry> entries
|
||||||
|
(let [entryFiles (FileSystem.readDirectory archiveDir)]
|
||||||
|
(doFor ))
|
||||||
|
:Array<System> systems []] // TODO also create systems
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun loadFromDir [archiveDir]
|
||||||
|
)
|
||||||
|
|
||||||
|
(defmethod :Void handleEvent [:Event e])
|
7
projects/nap/src/nap/Event.hx
Normal file
7
projects/nap/src/nap/Event.hx
Normal file
@@ -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 {}
|
0
projects/nap/src/nap/Lib.kiss
Normal file
0
projects/nap/src/nap/Lib.kiss
Normal file
@@ -1,4 +1,16 @@
|
|||||||
(defun :Void main []
|
(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")]
|
(let [e (new Entry "name")]
|
||||||
(dictSet e.components "f" [5])
|
(dictSet e.components "f" [5])
|
||||||
(dictSet e.components "b" [(object c "d")])
|
(dictSet e.components "b" [(object c "d")])
|
||||||
@@ -6,3 +18,4 @@
|
|||||||
:Entry e2 (haxe.Json.parse s)]
|
:Entry e2 (haxe.Json.parse s)]
|
||||||
// can't call Entry methods on e2
|
// can't call Entry methods on e2
|
||||||
(print s))))
|
(print s))))
|
||||||
|
*/
|
4
projects/nap/src/nap/System.hx
Normal file
4
projects/nap/src/nap/System.hx
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package nap;
|
||||||
|
|
||||||
|
@:build(kiss.Kiss.build())
|
||||||
|
class System {}
|
1
projects/nap/src/nap/System.kiss
Normal file
1
projects/nap/src/nap/System.kiss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(defprop :List<Entry> entries [])
|
3
projects/nap/src/nap/components/Tag.hx
Normal file
3
projects/nap/src/nap/components/Tag.hx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package nap.components;
|
||||||
|
|
||||||
|
typedef Tag = String;
|
0
projects/nap/src/nap/components/Tag.kiss
Normal file
0
projects/nap/src/nap/components/Tag.kiss
Normal file
Reference in New Issue
Block a user