fix C++ type error for playground

This commit is contained in:
2021-09-18 18:33:44 -06:00
parent 65323a3d96
commit 1e44f1db11
4 changed files with 32 additions and 12 deletions

View File

@@ -38,11 +38,10 @@
// TODO allow configuring the tags at runtime and erasing/re-creating sprites later
// TODO allow using other position keys and erasing/re-creating sprites later
(let [entrySpriteSystem (new EntrySpriteSystem "!done" "Playground-MAIN" this)]
(archive.addSystem entrySpriteSystem)
(entrySpriteSystem.process archive))
)
(prop &mut :EntrySpriteSystem spriteSystem)
(set spriteSystem (new EntrySpriteSystem "!done" "Playground-MAIN" this))
(archive.addSystem spriteSystem)
(spriteSystem.process archive))
(method &override :Void update [:Float elapsed]
(super.update elapsed)
@@ -153,9 +152,13 @@
(method handleChanges [:Archive archive :ChangeSet changeSet]
// TODO refresh the sprites/other UI elements for entries that changed data
(doFor e changeSet
(print (archive.fullString e))))
// refresh the sprites for entries that changed data.
// Entries whose data changed to remove them from the sprite pool will already have been removed
// by refreshEntry()
(when (spriteSystem.entries.exists e.id)
(spriteSystem.onRemoveEntry e)
(spriteSystem.processEntry e))))
(prop &mut :Int uiY 0)