print when writing component

This commit is contained in:
2021-09-27 19:48:39 -06:00
parent 4e211b1a46
commit e18f294b97

View File

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