Skip to content

Can raze work without a view reference? #11

Description

@viridia

The .raze() method of View requires several parameters:

  • A DeferredWorld
  • The View that was used to create the view output.
  • The View::State.

So for example, Element::raze() uses the element's entity id (to despawn it) as well as the child views and the components, which also may need cleanup.

However, having to keep around both the View and View::State in order to cleanup View::State is troublesome. It would be convenient if somehow View::State could be despawnable by itself, but this would mean that it would have to have a more complex type, and this is true for every type that implements View.

Views are especially troublesome to keep around since, in general, they are not copyable or cloneable. This means having to wrap them in an Arc or some other container in order to keep them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions