Completely change naming conventions of field forms and definition macros. Close #32

This commit is contained in:
2021-07-24 14:22:10 -06:00
parent 9d6a4b2054
commit f5a5cdfb40
67 changed files with 433 additions and 447 deletions

View File

@@ -10,14 +10,14 @@
(let [entryFiles (FileSystem.readDirectory entryDir)]
(for file entryFiles =>(file.withoutExtension) (the Entry (Json.parse (File.getContent (joinPath archiveDir "entries" file)))))))])
(defmethod addSystem [:System system]
(method addSystem [:System system]
// Assign entries to the Systems that care about them
(doFor =>id entry entries
(system.checkEntryInOrOut this entry))
(systems.push system)
system)
(defmethod :Entry createEntry [:Entry->Dynamic initializer] // initializer returns Dynamic so ->:Void isn't required
(method :Entry createEntry [:Entry->Dynamic initializer] // initializer returns Dynamic so ->:Void isn't required
(let [e (_newEntry)]
(initializer e)
(dictSet entries e.id e)
@@ -26,20 +26,20 @@
// After modifying an entry, this must be called. If you are writing in a createEntry initializer or a system's processEntry function, this will happen automatically.
// Otherwise, you can guarantee it happens automatically by using the (withWritableEntry) macro in Lib.kiss
(defmethod refreshEntry [:Entry e]
(method refreshEntry [:Entry e]
(_saveEntry e)
(doFor system systems
(system.checkEntryInOrOut this e)))
(defmethod _saveEntry [:Entry e]
(method _saveEntry [:Entry e]
(File.saveContent
(joinPath archiveDir "entries" (e.id.withExtension "json"))
(Json.stringify e)))
(defmethod componentData [:Entry e :String componentType]
(method componentData [:Entry e :String componentType]
(haxe.Json.parse (File.getContent (joinPath archiveDir "components" "$(dictGet e.components componentType).json"))))
(defmethod fullData [:Entry e]
(method fullData [:Entry e]
(object
id e.id
components
@@ -48,11 +48,11 @@
files
e.files))
(defmethod fullString [:Entry e]
(method fullString [:Entry e]
(haxe.Json.stringify (fullData e) null "\t"))
(defun :Entry _newEntry []
(function :Entry _newEntry []
(object
id (Uuid.v4)
components (new Map)
files []))
files []))