print when writing component

This commit is contained in:
2021-09-27 19:48:39 -06:00
parent e756e71b95
commit 9b9fa4fa3c

View File

@@ -19,10 +19,12 @@
// Components have to be saved individually after writing because the Entity only knows their ids,
// not the data they contain. This is more ergonomically done by using (withWritableComponents...)
(defMacro writeComponent [archive e componentType c]
`(sys.io.File.saveContent
(_componentPath ,archive ,e ,componentType)
(tink.Json.stringify
(the nat.components ,componentType ,c))))
`{
(print (+ "saving " (the nat.components ,componentType ,c) " as " ,(symbolName componentType) " for " .id ,e))
(sys.io.File.saveContent
(_componentPath ,archive ,e ,componentType)
(tink.Json.stringify
(the nat.components ,componentType ,c)))})
// TODO check not overwriting a component
(defMacro addComponent [archive e componentType c]