add lightSources jsonMap to Movie

This commit is contained in:
2023-03-29 07:12:49 -06:00
parent 76c8e2283d
commit e400d6d558
4 changed files with 12 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import haxe.ds.Map;
import haxe.Json;
import haxe.DynamicAccess;
import sys.io.File;
import sys.FileSystem;
typedef Jsonable<T> = {
function stringify():String;

View File

@@ -12,6 +12,9 @@
(defNew [&prop :String jsonPath &prop :T defaultVal]
[:Map<String,T> m (new Map)]
(unless (FileSystem.exists jsonPath)
(File.saveContent jsonPath "{}"))
(_parseFrom (File.getContent jsonPath)))
(method put [:String key :T value]