diff options
author | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-18 21:07:55 -0600 |
---|---|---|
committer | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-18 21:07:55 -0600 |
commit | 9b597426ac45775f63b1fe4365c6fa8f3c3179af (patch) | |
tree | 0768f5aebcd9ef9f60824f389e1e197f32e4e578 /src/systems/undo.js | |
parent | 1cffeb5520e416893a93545dc4356365b762a1f7 (diff) | |
download | bbiy-9b597426ac45775f63b1fe4365c6fa8f3c3179af.tar.gz bbiy-9b597426ac45775f63b1fe4365c6fa8f3c3179af.zip |
Wow this is some shitty fucking code god damn
Diffstat (limited to 'src/systems/undo.js')
-rw-r--r-- | src/systems/undo.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/systems/undo.js b/src/systems/undo.js index 29f5bec..086d6b4 100644 --- a/src/systems/undo.js +++ b/src/systems/undo.js @@ -1,4 +1,4 @@ -game.system.Undo = (entitiesGrid) => { +game.system.Undo = (entitiesGrid, logicSystem, gridSystem) => { const states = []; const update = (elapsedTime, entities, changedIds) => { @@ -12,7 +12,7 @@ game.system.Undo = (entitiesGrid) => { states.push(state); } return new Set(); - } + }; const undo = (entities) => { let state = states.slice(0, -1).pop(); @@ -24,7 +24,9 @@ game.system.Undo = (entitiesGrid) => { entities[id].addComponent({name: componentName, ...state[id][componentName]}); } } - } + gridSystem.update(0, entities, new Set()); + logicSystem.parseRules(entities); + }; return { update, undo }; -}
\ No newline at end of file +}; |