Skip to content

Commit

Permalink
feat: world.dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
3mcd committed Mar 1, 2021
1 parent 114fe7a commit 2ac3378
Show file tree
Hide file tree
Showing 24 changed files with 151 additions and 75 deletions.
2 changes: 1 addition & 1 deletion docs-src/content/ecs/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "ECS"
weight = 2
weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++
Expand Down
4 changes: 4 additions & 0 deletions docs-src/content/ecs/world.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ if (world.tryGetComponent(entity, Invulnerable) === null) {
// an entity of (Health, Burn) should always have a position
world.getComponent(entity, Position)
```

## Clearing Data

Use `world.reset()` to completely reset a world. This method will clear all entity and component data, attempting to release pooled components along the way.
2 changes: 1 addition & 1 deletion docs-src/content/installation/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Installation"
weight = 1
weight = 2
+++

## npm
Expand Down
2 changes: 1 addition & 1 deletion docs-src/static/javelin-ecs.bundle.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/ecs/change-detection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/effects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/entities/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/filtering/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/performance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/systems/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/ecs/topics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
13 changes: 9 additions & 4 deletions docs/ecs/world/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@

<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down Expand Up @@ -220,6 +220,11 @@ <h2 id="finding-components">Finding Components<a class="zola-anchor" href="#find
<pre><code>// an entity of (Health, Burn) should always have a position
world.getComponent(entity, Position)
</code></pre>
<h2 id="clearing-data">Clearing Data<a class="zola-anchor" href="#clearing-data" aria-label="Anchor link for: clearing-data"
>#</a
>
</h2>
<p>Use <code>world.reset()</code> to completely reset a world. This method will clear all entity and component data, attempting to release pooled components along the way.</p>

</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions docs/installation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@



<li class="active">
<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li >
<li class="active">

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
12 changes: 6 additions & 6 deletions docs/introduction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@



<li >
<li class="active">

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">

Installation
Introduction
</a>

</li>


<li class="active">
<li >

<a href="https:&#x2F;&#x2F;javelin.games&#x2F;introduction&#x2F;">
<a href="https:&#x2F;&#x2F;javelin.games&#x2F;installation&#x2F;">

Introduction
Installation
</a>

</li>
Expand Down
Loading

0 comments on commit 2ac3378

Please sign in to comment.