Closed hmans closed 2 years ago
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders
Latest commit: d775492e5df996b2a33821b916df13a30fd4065e
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Added an
update
function to theWorld
class that allows the user to update an entity. This is intended to complement the other two mutating functions (addComponent
,removeComponent
), simply to allow for the use of syntactic sugar (component constructor functions, entity factories, etc.) in a streamlined fashion:The main job of the function is to re-index the updated entity against known derived buckets, and since in Miniplex you'll typically mutate entities directly, it can even be called with only an entity. All of the above are essentially equivalent to: