Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: world.reset #135

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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